+ 1
What is the output? (Explain)
/* Can someone give me a better solution and explain me how to get the output for this source code? */ #include <stdio.h> #include <string.h> char *f(int p, char *s) { s[p+2] = '\0'; return s-1; } int main(void) { char s[] = "ABCDEF"; int i = strlen(f(1, s+2)); printf("%d\n", i); return 0; }
1 Resposta
+ 1
Go into the Code section of SoloLearn, press the "+" icon to add new code, select C language, then enter your code and run. There you can see the output and experiment to understand it better.