Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/13/02 18:52
Read: times


 
#32421 - RE: Parsing Arrays in uC51
I'm not sure why you have used [3] unless you group by threes, but your nextString function doesn't use this information. I will ignore these and just assume an array of strings. Also, you need to insert a null at the end of the list to know when to stop.

Below is an approach to doing this...

<>< Lance.


code uchar *textArray[] = {"bla","blub","Bla",
"qwe","qwer","qwe", null};
uchar **nextString;

void setFirstString( uchar **firstStr ) {
nextStr = firstStr;
}

uchar *nextString() {
return (nextStr!=null) ? *(nextStr++) : null;
}

Use it like...
uchar *str;
setFirstString( &textArray[0] );
while( (str=nextString()) != null )
do_something(str);


List of 3 messages in thread
TopicAuthorDate
Parsing Arrays in uC51            01/01/70 00:00      
RE: Parsing Arrays in uC51            01/01/70 00:00      
RE: Parsing Arrays in uC51            01/01/70 00:00      

Back to Subject List