i have to read from the file all the data before ' : ' and then omit the current and go to the next line and read the data.
e.g.
Numbers:
1, 2, 3;
Font:
6, 7, 8;
and i have got the first 2 lines and no luck with the last 2.
File.getline(temp,200,':');
strcpy(temp2,"Numbers");
if (strcmp(temp,temp2)==0)
{
File.getline(temp,200,';');
int i=0;
char* token;
int buffer[200];
token = strtok( temp, ",;");
while( token != NULL )
{
buffer[i]=i;
token = strtok( NULL, ",;");
i++;
}
alphabets= new int[i];
for(int j=0;j<i;j++)
{
alphabets[j]=buffer[j];
}
numAlphabets=i;
}
strcpy(temp2,"Font");
if (strcmp(temp,temp2)==0)
{
File.getline(temp,200,';');
int i=0;
char* token;
char buffer[200];
token = strtok( temp, ",;");
while( token != NULL )
{
buffer[i]=i;
token = strtok( NULL, ",;");
i++;
}
states= new int[i];
for(int j=0;j<i;j++)
{
states[j]=buffer[j];
}
numStates=i;
}