whats wrong with this function?
I just made this function a miniute ago, and its suppost to remove the space off of the beginning of a string. It compiles fine, but doesn't seem to do anything at all to the string. Im not sure why its not working. Thanks! Also, I was searching the forum for a possiable answer to this before, and one of the posts made a reference to 'isspace()'. What header does that function lie in?
In main, it prints the string just as it was before, with the spaces in the front. Thanks for any help!
cout << command;
char a_remove_space(char string)
int i2=0; //used in local embedded loop
int last_slot=0; //the slot of the string that a space is no longer found
//remove spaces from string
if(string[i]!='/0') //if we found a slot without a space then continue
last_slot=i; //get the slot of the string that we found the letter
for(i2=last_slot;i2<(strlen(string));i2++) //initialize a new loop to re-fill the array
newstring[i2-last_slot]=string[i2]; //refill the array
if(done==true) break; //exit the base for...loop if done is set to true