Quote:
Originally Posted by billyjay777
i am having a hard time understanding how to increment both pointers. I understand that they both start at the same point in there arrays, but i don't understand how to increment them to go to the next character in the array on the first array, but then tell the second array to skip the space.
that is the hardest thing i am dealing with so far i have this now.
void stripWhite(char* str)
{
char str2[100];
char *p;
p=str;
char*t;
t=str2;
{
if(*(p)!=' ')
{
t=p;
}
}
cout<<t<<endl;
}
Hi, I think according to your question it just tells me to use pointers and as what I have posted there is a pointer too (i.e char* str). Also as Banfa said
arr[4] is equivalent to *(arr+4) that too is a pointer. So dont get panic about pointers. Use pointers whenever required. In your question it is never said that you have to use two pointers one for source and the other for destination.....I just tells me to use pointers....
Try something which is simple and the best solution.
Thankx