Hi,
Trying to write a program that reads C files and so need to ignore comments. I'm using the strtok function
strtok(myline, "//")
to remove single line comments. However, this tokenises everything after just one forwards slash.
I then tried to store two forwards slashes in an array, eg:
char *delim[1] = {"//"};
strtok(myline, delim[0]);
to try to solve this, my the line still tokenises after one forward slash. This causes problems if, for example, there is a mathematcial division in the line.
Any help greatly appreciated.
Bill