4
What is wrong?
#include <stdio.h>
#include <string.h>
int main(void) {
char *str= " teste";
int j = 0;
while(str[j] == ' ') j++;
memcpy(str, &str[j], strlen(&str[j])+1);
printf("%s", str);
return 0;
}
When I execute the code I only get as output:
Falha de segmentação (imagem do núcleo gravada)
While waiting for the spaces to be removed from str
, something close to function trim()
javascript.