It isn't neccessary a nested loop.You can do it with one loop like the following code...(Assume that j = 0 at starting)
for(i=0 ;i<=num; i++) // loop to store values in array
{
if (str[i] != ' '){
result[j]= str[i];
j++;
}
}
FoX_
Junior Poster in Training
53 posts since Mar 2007
Reputation Points: 10
Solved Threads: 7
you don't need the j loop. Just delete line 10 and increment it in line 14. Don't forget to initialize j in line 5.
[edit]Just like Fox showed[/edit]
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343