0

How to get user input in c.. As a+b.. As like java scanner.. How in c

Mm..

7th Sep 2017, 6:53 AM
Syed Ghouse
2 odpowiedzi
+ 3
Some functions work great in C The easiest way is scanf that allow you to read any type but breaks your program if the type is wrong (you asked for an int and got some letters) Then there are functions for getting characters and strings : gets, getc, getchar, ... Those are safer but you'll have to convert the result to the type you want to have
7th Sep 2017, 6:58 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
fgets then, if you read online linux manual for those functions, you'll find lots of others with nearly the same behavior :)
7th Sep 2017, 12:45 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar