Skip to content

Commit 7c1a3cf

Browse files
authored
Correct escape sequence in printf statement
it is given that we have to check what happens when we put a incorrect escape sequence like \c given in the question. Previous code had "hello, world\\c" has the printf argument which just prints 'hello world\c' instead of checking what error does it show for entering incorrect escape sequence. I have also commented the error produced as per the GCC compiler
1 parent bdcee72 commit 7c1a3cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <stdio.h>
22

33
int main(void) {
4-
printf("hello, world\\c");
4+
printf("hello, world\c"); /*prints warning: unknown escape sequence '\c' */
55
return 0;
66
}

0 commit comments

Comments
 (0)