echo '' ;

Archives

C Library – stdio.h

The stdio.h header file in C is a standard input-output library that provides functions for input and output operations. It stands for “standard input-output header”. This header file declares several functions, including printf, scanf, fopen, fclose, fread, fwrite, etc., as well as various macros and data types.

  • std means Standard and io means Input-output statements
  • These statements are used to get and put data on computers
  • Ex-1: Can put data to a computer via the keyboard.
  • Ex-2: Can get data and see that in Monitor.
  • Input-output statements are used as a function in c language
  • stdio.h file contains that statements statements
  • So if we use these functions should include stdio.h , functions are  scanf()  , printf()   , getchar() , gets() , putchar() ,  puts().

Here’s a brief overview of some commonly used functions and macros declared in stdio.h:

  1. printf: Used to print formatted output to the standard output (usually the console).
  2. scanf: Used to read formatted input from the standard input (usually the keyboard).
  3. fprintf, fscanf, sprintf, sscanf: Variants of printf and scanf for performing formatted I/O operations on files or strings.
  4. FILE: Data type representing a file stream used by functions like fopen, fclose, fread, fwrite, etc.
  5. stdin, stdout, stderr: Predefined file streams representing standard input, standard output, and standard error respectively.

Including stdio.h at the beginning of your C program allows you to use these functions and macros. It’s an essential header file for most C programs, as it provides basic input and output capabilities.

Read more… →