Hi!
Can anyone help with a code I spend a week and cannot do it! I dunno why it does not work...
Code:
#include <stdio.h>
#include <string.h>
#define SIZE 100
int strip()
{
char s[100];
printf ("Enter some string \n");
//printf ("1\n");
fgets( s, 90, stdin);
//printf ("2\n");
int size;
size=strlen(s);
//size=sizeof(s)/sizeof(char);
//printf ("3\n");
int i=0;
for (i; i<size; i++)
{
if(s[i]!=' '|| s[i]!='\t')
{
printf ("Why I am not working????\n");
printf ("%c", s[i]);
}
}
return 0;
}
int main()
{
//char *s[100];
//printf ("Enter some string: \n");
//scanf ("%s",s);
strip();
return 0;
}
when I am writting something like: "Good morning" it comes like "Good morning" however I wanted "Goodmorning" I guess there is smth wrong with
Code:
if(s[i]!=' '|| s[i]!='\t')
but I cannot understand what any help? Please Thanks, Sam