Searching for a string

Hi

I am writing a code for showing a student's mark list.
I have a file containing every student's name and his marks in each subject.
I have to make a drop down list to select the student's name and then accordingly a drop down list of all his subjects (slicking on which will show his marks in that subject).
The problem is how do I search for the name and extract all the subject names for the file?
Please Help
have you already started coding it?
Yes,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fgets(szLine, sizeof(szLine), pFile;
char szLine[2048]="";
        char * pch;
        char * pch2;
        do
        {
        if(pch!=pch2)
        {
                cout<<*pch<<endl;
                pch++;
                pch2 = strstr (szLine,"FU");
                pch=pch2-5;
                //return 0;
                }
        }
        while(fgets(szLine, sizeof(szLine), pFile));


'm trying to locate the "Course Name" before keyword FUT. (Every Course Name precedes FUT in the file(5 digits)).
Never Mind..
Got it..


1
2
3
4
5
6
7
8
9
10
11
char szLine[2048]="";
        fgets(szLine, sizeof(szLine), pFile);
        char * pch = NULL;
        do
        {
                        pch = strstr (szLine,"FU");
                        *pch = '\0';
                        cerr<<pch-5<<endl;
        }
        while(fgets(szLine, sizeof(szLine), pFile));
        return 0;

Topic archived. No new replies allowed.