C fputs() and fgets()The fputs() and fgets() in C programming are used to write and read string from stream. Let's see examples of writing and reading file using fgets() and fgets() functions. Writing File : fputs() functionThe fputs() function writes a line of characters into file. It outputs string to a stream. Syntax: Example: myfile2.txt hello c programming Reading File : fgets() functionThe fgets() function reads a line of characters from file. It gets string from a stream. Syntax: Example: Output: hello c programming
Next TopicC fseek()
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week