Hello all. This is my second thread where I've failed to work out string manipulation, and it's fairly similar to my first one. Basically, I've got a string, and I'm looking to remove anything that's placed within angled brackets, as well as the brackets themselves. Here's a snipet of code taken from a function that does what I'm trying to do.
Without this code the program runs through fine, but with this, it stalls when it reaches here.Code:char newline[512] = {0}, tmp[512] = {0}; char *ptr, *ptr2; while ((ptr = strstr(newline, "<")) != NULL) { while ((ptr2 = strstr(newline, ">")) != NULL) { strcpy(tmp, ptr2); *ptr = 0; strcpy(newline, tmp); } }
If anyone needs any more of the code to work it out, I'll post it. Just don't wanna slow you guys down with useless stuff.
Any help is appreciated![]()



LinkBack URL
About LinkBacks



