Function to get a string and return same after processing in C
- by C0de_Hard
I am working on a code which requires a function. This function gets a string as input and returns a string.
What I have planned so far is to get a str[], remove all $'s and spaces, and store this in another string which is returned later:
char *getstring(char str[])
{
int i=0;
char rtn[255];
while (i<strlen(str))
{
if (str[i] != " " || str[i] != "$" )
rtn[i] = str[i];
else
rtn[i] = '';
}
return str;
}
I dont feel like this will work. Any ideas?? :-S