Library Header
Library Header
Header
A function is a block of organized, reusable code that is used to
perform a single, related action.
A function definition in C programming consists of a function header and a function body. Here
are all the parts of a function −
Return Type − A function may return a value. The return type is the data type of the value the
function returns. Some functions perform the desired operations without returning a value. In
this case, the return type is the keyword void.
Function Name − This is the actual name of the function. The function name and the
parameter list together constitute the function signature.
Parameter List − A parameter is like a placeholder. When a function is invoked, you pass a
value as a parameter. This value is referred to as the actual parameter or argument. The
parameter list refers to the type, order, and number of the parameters of a function.
Parameters are optional; that is, a function may contain no parameters.
Function Body − The function body contains a collection of statements that defines what the
function does.
The Standard Function Library in C++ is what keeps you
from having to rewrite even the simplest of programming
instructions. It is like a huge library of sub-libraries, each of
which contains the underlying code for several functions. In
order to make use of these libraries, you link to each library
in the broader library through the use of header files.
Input Stream: If the direction of flow of bytes is from the device(for example,
Keyboard) to the main memory then this process is called input.
Output Stream: If the direction of flow of bytes is opposite, i.e. from main
memory to device( display screen ) then this process is called output.
Sr. No. Key Header file Library
1.Standard C Library
• There are 19 header files in the Standard C Library. All files have the .h file extension.
Examples: #include <stdio.h>
#include <string.h>
• Includes 30 additional header files (49 total) that are exclusive to C++
#include <windows.h>
header file is used to access the Win32 API (API stands for
Application Programming Interface) functions and it makes it
easier for the user to use the in-built functionality.
The thing that actually displays stuff on the screen (which in your
requirement is listed as "native resizable win32 windows") is usually
called a Terminal Emulator. If you don't like the one that comes with
Windows there are a few alternatives.
Terminal emulation is the ability to make one computer
terminal, typically a PC, appear to look like another,
usually older type of terminal so that a user can access
programs originally written to communicate with the
other terminal type. Terminal emulation is often used to
give PC users the ability to log on and get direct access
to legacy programs in a mainframe operating system.
The word "terminal" comes from early computer
systems that were used to send commands to other
computers. Terminals often consist of just a keyboard and
monitor, with a connection to another computer. The
purpose of a terminal is not to process information (like a
typical computer), but to send commands to another
system. For example, a network administrator may use a
terminal to log in to a network and manage devices
connected to the network.
With modern computers, the word "terminal"
usually refers to a terminal program, or emulator,
which provides a text-based interface for typing
commands. This type of program is often
abbreviated "TTY" and may also be referred to as
a command-line interface.
The <unistd.h> header defines miscellaneous symbolic
constants and types, and declares miscellaneous
functions. unistd stands for "Unix standard"
<stdio.h>
The header file stdio.h stands for Standard Input Output. It has
the information related to input/output functions.
rand() //function
It returns a random integer value
Functions Conversion
kbhit() –(Keyboardhit)
is present in conio.h and used to determine if a key has been pressed
or not.
Getch() - (Getcharacter)
It will tell to the console wait for some time until a key is hit given after running of
program. By using this function we can read a character directly from the keyboard.
Generally getch() are placing at end of the program after printing the output on
screen.
srand
void srand (unsigned int seed);
Initialize random number generator
The pseudo-random number generator is initialized using the argument passed
as seed.
rand
i
Generate random number
What happens when the cursor of a window is moved off the edge
of the window or scrolling region, either as a result of a newline action
on the bottom line, or typing the last character of the last line?
Description:
The napms() routine delays the calling process
for ms milliseconds. This function is similar to delay() and nap().
NAME
endwin(); - suspend Curses session
DESCRIPTION
The endwin() function restores the terminal after Curses activity
by at least restoring the saved shell terminal mode, flushing any
output to the terminal and moving the cursor to the first column
of the last line of the screen. Refreshing a window resumes
program mode.