do something like:
int val;
then val=(int)w[i]

Thanks,
Tyler Littlefield
email: [EMAIL PROTECTED]
web: tysdomain-com
Visit for quality software and web design.
skype: st8amnd2005

  ----- Original Message ----- 
  From: Olufowobi Lawal 
  To: c group2 
  Sent: Friday, November 21, 2008 4:56 PM
  Subject: [c-prog] ascii space problem?That new guy!


  //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]



   

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

Reply via email to