Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
String
#include <stdio.h> #include <stdlib.h> #include <string.h> void a(char**strref){ ++strref; } int main() { char *s="hour"; a(&s); puts(s); return 0; } I think the result of the code is āourā,but not. Who can tell me why? š¹
3 Respostas
+ 4
You need to change ++strref; to ++*strref;
This is because without the * then itās just changing the value of strref inside the a function, not inside the main function.
P.S. Next time, please put the programming language as a tag!
+ 4
No worries!
+ 1
Thanks, Rowsej!