What is the output of the following C code:
#include<stdio.h>
int main()
{
char strc = "HACKEREARTH";
char *s = = str;
printf("%s\n", s++ +3);
return 0;
Answers
Answer:
Explanation:
gcc /tmp/mzj48mwpOT.c -lm
/tmp/mzj48mwpOT.c: In function 'main':
/tmp/mzj48mwpOT.c:4:13: warning: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
4 | char strc = "HACKEREARTH";
| ^~~~~~~~~~~~~
/tmp/mzj48mwpOT.c:5:11: error: expected expression before '=' token
5 | char *s = = str;
| ^
/tmp/mzj48mwpOT.c:5:13: error: 'str' undeclared (first use in this function); did you mean 'strc'?
5 | char *s = = str;
| ^~~
| strc
/tmp/mzj48mwpOT.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
/tmp/mzj48mwpOT.c:7:10: error: stray '\342' in program
7 | return 0;
| ^
/tmp/mzj48mwpOT.c:7:11: error: stray '\200' in program
7 | return 0;
| ^
/tmp/mzj48mwpOT.c:7:12: error: stray '\213' in program
7 | return 0;
| ^
/tmp/mzj48mwpOT.c:7:1: error: expected declaration or statement at end of input
7 | return 0;
| ^~~~~~