0% found this document useful (0 votes)
6 views3 pages

Lecture 10(Header Files)

Header files in C are essential files that contain function definitions and variables, imported using the #include directive. The document lists several standard header files, including stdio.h for input/output functions and string.h for string manipulation functions, along with their respective functionalities. Additionally, it mentions time-related functions for date and time localization.

Uploaded by

mfiuk9148
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Lecture 10(Header Files)

Header files in C are essential files that contain function definitions and variables, imported using the #include directive. The document lists several standard header files, including stdio.h for input/output functions and string.h for string manipulation functions, along with their respective functionalities. Additionally, it mentions time-related functions for date and time localization.

Uploaded by

mfiuk9148
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Header Files

What is Header File?

Header files are helping file of your C program which holds the definitions of various
functions and their associated variables that needs to be imported into your C program
with the help of pre-processor #include statement. All the header file have a '.h' an
extensions.
The header files can be requested using the preprocessor directive #include. The
default header file that comes with the C compiler is the stdio.h including a header file
means that using the content of header file in your source program.

Syntax:
#include <file>

Some Header Files

STANDARD INPUT/OUTPUT FUNCTION (STDIO.H)

Function Description

scanf read character, string, numeric data from a keyboard

print the “character, string, float, integer, octal and


printf
hexadecimal values” onto the output screen

reads a character from the terminal and returns it as an


getchar
integer

putchar displays the character passed to it on the screen

gets reads a line from stdin(standard input) into the buffer

puts writes the string str and a trailing newline to stdout.


C STRING CHARACTER FUNCTIONS(STRING.H)

Function Description

strcat concatenate two strings.

strcmp compare two strings.

strcpy copy a string.

strlen get string length.

strncat concatenate one string with part of another.

strncmp compare parts of two strings.

C TIME DATE LOCALIZATION FUNCTIONS

Function Description

clock get current system time

ctime return string that contains date and time information

difftime get the difference between two given times

getdate get the CPU time

setdate modify the system date

You might also like