The gets and puts functions offer simple alternatives to the use of scanf and printf for reading and displaying strings,as illustrated in the following example.
#include
main() /*read and write a line or text*/
{
char line[80];
gets(line);
puts(line);
}
This program utilizes gets and puts,rather than scanf and printf,to transfer the line of text into and out of the computer.
No comments:
Post a Comment