Coder's Guild Mailing List

Re: Pos of a char

Posted by pontingdavid@xxx.xxx on 2000-04-15

I managed to sort out the string thingy without hitch, the problem I now
get is as follows:

int StrPos( char Source[], char Target );

.
.

char Ch;
int Acr_Idx = -1;
.
.
while( Acr_Idx == -1 ){
	Ch = fgetc( I_File );              //I_File is opened mode "r"
	Acr_Idx = StrPos( Alphabet, toupper( Ch ) ); 
}

StrPos is aforementioned function - works fine in a test proggie

For some reason Acr_Idx never goes >-1, and by placing a debug line in
StrPos I can tell that toupper( Ch ) returns -1. Any ideas?