Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to ignore spaces in c programming?

Hi guys i’m kind of new to c programming so sorry if my question seems evident.
When i use scanf("%c",c) it counts space as a character so what should i do to ignore the spaces between input characters?
Any help would be much appreciated.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

the only thing you should do is to consider spaces as characters and scanning them like other characters. for example if you want to scan "a b" in characters, you should write {scanf("%c %c %c,&c1,&c2,&c3);} so that the space will be c2.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading