hi, im trying to change all my punctuation characters and space into \0 so i can get a word at a time from the entire string. however, i may get results like \0\0\0\0\0\helloword\0 is the front of helloworld is spaces. any advice? thanks
Code:while fget(Buffer, 200, myfile){ for(i =0; i <= strlen(Buffer); i++) { if(isspace(Buffer[i]) || ispunct(Buffer[i])) { continue; } else { tempBuffer[loopCount] = Buffer[i]; loopCount++; } } loopCount = 0; /* reset counter.. */ ........... ..........printf("%s", tempBuffer); //display string terminated by \0 }