CCIT
coder
Home
Courses
Contact
CCITcoder
Contents
Introduction to C
History of c
General Formats
IDE
Libaray Functions
DataType and Operation
Datatypes
Format specifiers
Operators
Keyword/Token
Cast Operator / type casting
Formatted I/O
Unformatted I/O
Conditional statements
If statement
Nested if
Ladder if statement
Ternary Operator
Switch statement
Iterative statements
While loop
for loop
do while
Nested loops
Composite Assignment Operators
Jump Statements
Functions
Introduction and types of function
Function arguments
Function returning value
Recursive Functions
Array
Array
Search
Multi-Dimensional Arrays
Char Arrays Strings
Pointers
Introduction Pointers
call by Value/ Reference
Passing arrays as argument
Pointer to Pointer
Function Pointer
Dynamic Memory Management
Structures
Structures
Array of Structure
Nested Structure
Structure Initialization
Union
File I/O
File I/O
Read/Write File I/O
37
Block I/O
Graphics
Graphics
Additional Features
Command Line Arguments
Preprocessor Commands
Contents
Introduction to C
History of c
General Formats
IDE
Libaray Functions
DataType and Operation
Datatypes
Format specifiers
Operators
Keyword/Token
Cast Operator / type casting
Formatted I/O
Unformatted I/O
Conditional statements
If statement
Nested if
Ladder if statement
Ternary Operator
Switch statement
Iterative statements
While loop
for loop
do while
Nested loops
Composite Assignment Operators
Jump Statements
Functions
Introduction and types of function
Function arguments
Function returning value
Recursive Functions
Array
Array
Search
Multi-Dimensional Arrays
Char Arrays Strings
Pointers
Introduction Pointers
call by Value/ Reference
Passing arrays as argument
Pointer to Pointer
Function Pointer
Dynamic Memory Management
Structures
Structures
Array of Structure
Nested Structure
Structure Initialization
Union
File I/O
File I/O
Read/Write File I/O
37
Block I/O
Graphics
Graphics
Additional Features
Command Line Arguments
Preprocessor Commands
Topics
Menu
Unformatted I/O
Unformatted I/O
Unformatted I/O transfers data in its raw form or binary representation without any conversions.
Unformatted I/O is the most basic form of I/O and it is simple, efficient and compact.
To perform unformatted I/O operations c language provides us different functions
Char I/O Functions
getchar() stdio.h
putchar() stdio.h
getche() conio.h
getch() conio.h
putch() conio.h
String I/O Functions
gets() stdio.h
puts() stdio.h
getchar()
This function will read a single character from the standard input.
The input is read until the Enter key is pressed, but only the first character in the input will be returned.
Syntax:
int getchar()
putchar()
It will print a single character on standard output.
The return value of putchar() is the character which was written to the output.
Syntax:
int putchar(int ch)
getch() / getche()
getch( ) /getche( ) reads a single character from the standard input.
In getch( ) the input character is not displayed (echoed) on the screen.
Unlike the getchar( ) function, getch( ) / getche( ) returns when the first character is entered and does not wait for the Enter key to be pressed.
Syntax:
int getch( )
int getche( )
putch()
It is used to display a char on Console.
Header file : conio.h
Syntax:
putch(int ch)
gets( )
It is used to reads a line from stdin
It reads a line and stores it into the buffer(block of memory) pointed by the specified buffer address.
It stops when the newline character is read.
Syntax:
gets(char *buffer)
puts( )
It is used to writes a string to stdout .
A newline character is appended to the output.
Syntax:
puts(char *str)
Previous topic
formatted I/O
Next topic
Conditional statements
Contents