M
Miguel
Why can I do this?? this is a cycle that when it reaches ? puts a
termination caracter \0, what I want to do is separate one String in
two
for(i=strlen(path);i>=0;i--){
if(!isspace(path)){
j++;
printf("nao e um espaço j->%d",j);
}
if (path=='?'){
path=='\0'; --------->>>>>>>>>>>SEGMENTACION FAULT HERE
buf = (char*) malloc(j*sizeof(char));
strcpy(buf,&path[i+1]);
}
}
termination caracter \0, what I want to do is separate one String in
two
for(i=strlen(path);i>=0;i--){
if(!isspace(path)){
j++;
printf("nao e um espaço j->%d",j);
}
if (path=='?'){
path=='\0'; --------->>>>>>>>>>>SEGMENTACION FAULT HERE
buf = (char*) malloc(j*sizeof(char));
strcpy(buf,&path[i+1]);
}
}