Language
C
Compiler
gcc 10.1.0
Options
Warnings
C11(GNU)
no pedantic
$ gcc prog.c -Wall -Wextra -std=gnu11
Enter your Name
->
Enter today's Date in DD/MM/YY format. For example - 18-02-21
-> MikeCAT_21-02-03.txt
Exit Code:
0
Author
anonymous
over 4 years ago
C
gcc 10.1.0
Author
anonymous
over 4 years ago
$ gcc prog.c -Wall -Wextra -std=gnu11
prog.c: In function 'main':
prog.c:14:29: warning: '.txt' directive writing 4 bytes into a region of size between 1 and 29 [-Wformat-overflow=]
14 | sprintf(filename, "%s_%s.txt",name,date);
| ^~~~
prog.c:14:5: note: 'sprintf' output between 6 and 34 bytes into a destination of size 30
14 | sprintf(filename, "%s_%s.txt",name,date);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter your Name
->
Enter today's Date in DD/MM/YY format. For example - 18-02-21
-> MikeCAT_21-02-03.txt