Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string manipulation

Status
Not open for further replies.

wavejunkie

Programmer
Joined
May 15, 2001
Messages
1
Location
US
I am trying to write a simple function that will return the first space character in a line of taxt. If the text does not contain a space character then the value 0 is returned.
My code so far is as follows:

int FirstSpace(String Line)
{
int Index;
for(Index = 1; Index <= Length(Line))
{
if(Line[Index] == 32)
(
WriteIntCr(FirstSpace(String Line));
else
{
WriteIntCr(0);
}
}

Hope you can help
thanks
wavejunkie
 
int xyz(char *line)

int index;


for(index = 0; index < strlen(line); index++)
{
if( line[index] = ' ')
{
return 1;
}
}

return 0;

I think this should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top