I have written the inbuilt gets() and puts() function....
Can anyone help me to make it much more simpler...
snivas519
0
Newbie Poster
Recommended Answers
Jump to PostThe getstr function is dodgy. scanf() is looking to take in just one char, but the user is trying to enter a string. And scanf() has to have an enter key to assign a value (buffered input).
fgets() is the function that immediately comes to mind for string entry. …
Jump to Postfgets() is a very good standard C way, to get a line of char's. You need a char buffer, where fgets() will put the chars, and you need some little bit of code:
char buffer[100]; //make it bigger than any line should be fgets(buffer, sizeof(buffer), stdin);
sizeof() …
All 5 Replies
Adak
419
Nearly a Posting Virtuoso
snivas519
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
snivas519
0
Newbie Poster
snivas519
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.