View Single Post
Join Date: Jan 2008
Posts: 6
Reputation: Matt You is an unknown quantity at this point 
Solved Threads: 0
Matt You Matt You is offline Offline
Newbie Poster

scanning char array for \0 problem

 
0
  #1
Jan 22nd, 2008
I'm trying to make a function that can scan a char array, and finish it's business when it comes to a '\0'. so here is the for loop i came up with:
  1. for( i=0 ; charArray[i] != '\0' ; i++ )
But here is an example of entered data: "1234 432"

It seems to end the loop at the space. So are spaces and null characters similar? how can i differentiate between the two so that it keeps going right through a space and only stops at a null?
Reply With Quote