Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - String output and input

Node:String output and input, Next:, Previous:High-level file routines, Up:Input and output



String output and input

We will now examine some high-level file functions for reading strings from and writing strings to streams. The two string output methods we will examine (puts and fputs) are very safe to use, but the input methods run from the antiquated and very dangerous gets to the safer fgets, to getline and getdelim, two GNU-specific extensions to the C language that are extremely safe to use.

It is important to use the safer and better GNU functions when you can. However, you will probably still want to learn how to read and understand older (but still free) code that is unsafe (perhaps to update it and make it safe), so this book describes functions like gets despite the fact that they are unsafe.

 
 
  Published under free license. Design by Interspire