Sunday, 27 August 2017

C | Scanf problem while scanning a string

/* FIX: Leave a space before %c */
 
 
eg:
   for(i=0;i<5;i++)
    scanf("   %c",&string[i]);  

 
 
This will eat newline character and also special character.
Thank you,
 
 

No comments:

Post a Comment

Thanks For Reading! Visit Again