//This program removes a space from a string.

#include<stdio.h>
#include <STRING.H>
main()
{
  char w[50];
  int i;
  scanf("%s",&w);

for(i=0;i<strlen(w);i++)
    {
    if(w[i]==65)
    continue;
    printf("%c",w[i]);
    }
    
}

for an input: dAd
output dd, as expected

when changed to if(w==32)
32 asci for space

for an input:d d
output is d


why is this so?

I also tried using   if(w=='')  but i got the same result.

any ideas on how to implement this? Or where I'm gettin it wrong.


      

[Non-text portions of this message have been removed]

Reply via email to