fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. char name;
  7. int age, i;
  8.  
  9. printf("Enter your first name letter: ");
  10. fflush(stdin);
  11. //scanf("%c", &name);
  12. name = getchar();
  13. // wyczysc bufor
  14. fflush(stdin);
  15. printf("Enter your age: ");
  16. scanf_s("%d", &age);
  17. printf("Mr. %c , %d years old.\n", name, age);
  18. printf("Enter a hexadecimal number: ");
  19. scanf_s("%x", &i);
  20. printf("You have entered %#x (%d).\n", i, i);
  21. system("pause");
  22. return 0;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:16:2: warning: implicit declaration of function ‘scanf_s’; did you mean ‘scanf’? [-Wimplicit-function-declaration]
  scanf_s("%d", &age);
  ^~~~~~~
  scanf
prog.c:21:2: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
  system("pause");
  ^~~~~~~~~~~~~~~
/usr/bin/ld: /home/Szq4J2/cc4KACvN.o: in function `main':
prog.c:(.text.startup+0x6c): undefined reference to `scanf_s'
/usr/bin/ld: prog.c:(.text.startup+0xab): undefined reference to `scanf_s'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty