I am running Linux and what I am trying to do here is make a program that will start and stop after reaching specific indicators such as '}' would be an indicator for closing a statement in some programming languages. So for example, if I have:
void main (void)
{
FILE *fp;
fp = fopen("readthis.txt", "r");
int ch = fgetc(fp)
while (ch != EOF)
{
fprintf(fp, "%c", ch);
}
}
How would I pick and choose what does get read and what doesn't? I didn't want to just throw in strcmp's and cross my fingers. Maybe the solution is simple, thanks in advance. Let's assume I want to start reading after every asterisk (*) and read until the end-of-file. Also, lets say the file contained:
This doesn't get read * This gets read.