[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Stupid C code..



Hi all

  Following program is not working and it's beyond me why it's so...
Please help...
Give a multiword string without initial white spaces as input.

Sorry if I am posting a stupid query...

 Bye
  Shridhar

#include <stdio.h>
#include <string.h>

main()
{
 char a[100], *b;
 int flag=0,i=0,j=0,ftemp=0,fieldno=2;
 char *ptr,*line ;

 printf("\nEnter a string.. ");
 gets(a);

 line=a;

  if(line[0]!=32||line[0]!=9)  /*Line has no initial white spaces*/
  {
   ftemp++;
   while(line[i]!=0||line[i]!=32||line[i]!=9){printf(" %d",line[i]);i++;}
  }

printf("\nSafe out here...");

 }