FAMILIARIZATION WITH PROGRAMMING ENVIRONMENT
C is a general-purpose, imperative computer programming language, supporting structured
programming, lexical variable scope and recursion. By design, C provides constructs that map
efficiently to typical machine instructions, and therefore it has found lasting use in
applications that had formerly been coded in assembly language, including operating systems,
as well as various application software for computers ranging
from supercomputers to embedded systems.
C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, and used
to re-implement the Unix operating system. It has since become one of the most widely used
programming languages of all time, with C compilers from various vendors available for the
majority of existing computer architectures and operating systems. C has been standardized by
the American National Standards Institute (ANSI) since 1989 (see ANSI C) and subsequently
by the International Organization for Standardization (ISO).
C is an imperative procedural language. It was designed to be compiled using a relatively
straightforward compiler, to provide low-level access to memory, to provide language
constructs that map efficiently to machine instructions, and to require minimal run-time
support. Despite its low-level capabilities, the language was designed to encourage cross-
platform programming. A standards-compliant and portably written C program can be
compiled for a very wide variety of computer platforms and operating systems with few
changes to its source code. The language has become available on a very wide range of
platforms, from embedded microcontrollers to supercomputers.
IDE: An integrated development environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software
development. An IDE normally consists of a source code editor, build automation
tools, and a debugger.
Compiler: A compiler is a software program that compiles program source code files into an
executable program. It is included as part of the integrated development environment IDE
with most programming software packages.
The compiler takes source code files that are written in a high-level language, such as C,
BASIC, or Java, and compiles the code into a low-level language, such as machine code or
assembly code. This code is created for a specific processor type, such as and Intel
Pentium or PowerPC. The program can then be recognized by the processor and run from the
operating system.
C++ built-in Header Files
alloc.h dos.h limits.h share.h sys\stat.h
assert.h errno.h locale.h signal.h sys\timeb.h
bcd.h fcntl.h malloc.h stdarg.h sys\types.h
bios.h float.h math.h stddef.h time.h
complex.h fstream.h mem.h stdio.h utime.h
conio.h generic.h memory.h stdiostr.h values.h
ctype.h graphics.h new.h stream.h varargs.h
dir.h io.h process.h string.h sys\stat.h
direct.h iomanip.h search.h strstrea.h sys\timeb.h
dirent.h iostream.h setjmp.h sys\locking.h sys\types.h
List of best and free C/C++ compilers and IDEs for Programmers
Eclipse Dev C++ GCC CC65
NetBeans CodeLite Xcode LCC
Code::Blocks MinGW Tiny C – Compiler SDCC
Digital Mars: Ultimate++ Portable C Compiler nesC
C Free Mirosoft Visual Failsafe C CC386
Studio Express
Sky IDE Open Watcom Pelles C SubC
Turbo C++ TurboC3
TC
Turbo C++ Keyboard Shortcuts
Shortcut Actio Shortcuts Shortcut
Action Action
s keys n keys s keys
For
F1
Help
Alt+X Quit Ctrl+F9 Run
F2 Save Alt+Bksp Undo Ctrl+F2 Program reset
F3 Open Shift+Alt+Bksp Redo Alt+F9 Compile
Go to
F4
cursor
Shift+Del Cut Alt+F4 Inspect
F5 Zoom Ctrl+Ins Copy Ctrl+F4 Evaluate/Modify
F6 Next Shift+Ins Paste Ctrl+F3 Call stack
Trace Toggle
F7
into
Ctrl+Del Clear Ctrl+F8
breakpoint
Step Search
F8
over
Ctrl+L Ctrl+F5 Size/Move
again
Previous
F9 Make Alt+F7 Alt+F3 Close
error
Next
F10 Menu Alt+F8 Alt+F5 User screen
error
Alt+0 List all Shift+F1 Index Ctrl+F7 Add watchb
Topic Previous
Ctrl+F1 Alt+F1
search topic
Data Types available in C++:
1. Primary(Built-in) Data Types:
o character
o integer
o floating point
o boolean
o double floating point
o void
o wide character
2. User Defined Data Types:
o Structure
o Union
o Class
o Enumeration
3. Derived Data Types:
o Array
o Function
o Pointer
o Reference
The lists of modifiers used in C++ are:
signed
unsigned
long
short
Data Type Description Size Typical Range
(Keywords)
char Any single 1 byte -128 to 127 or 0 to
character. It may 255
include a letter, a
digit, a punctuation
mark, or a space.
signed char Signed character. 1 byte -128 to 127
unsigned char Unsigned 1 byte 0 to 255
character.
wchar_t Wide character. 2 or 4 bytes 1 wide character
Data Type Description Size Typical Range
(Keywords)
int Integer. 4 bytes -2147483648 to
2147483647
signed int Signed integer. 4 bytes -2147483648 to
Values may be 2147483647
negative, positive,
or zero.
unsigned int Unsigned integer. 4 bytes 0 to 4294967295
Values are always
positive or zero.
Never negative.
short Short integer. 2 bytes -32768 to 32767
signed short Signed short 2 bytes -32768 to 32767
integer. Values may
be negative,
positive, or zero.
unsigned Unsigned short 2 bytes 0 to 65535
short integer. Values are
always positive or
zero. Never
negative.
long Long integer. 4 bytes -2147483648 to
2147483647
signed long Signed long integer. 4 bytes -2147483648 to
Values may be 2147483647
negative, positive,
or zero.
unsigned Unsigned long 4 bytes 0 to 4294967295
long integer. Values are
always positive or
zero. Never
negative.
Floating-point Data Types
Data Type Description Size Typical Range
(Keywords)
float Floating point 4 bytes +/- 3.4e +/- 38 (~7
number. There is no digits)
fixed number of digits
before or after the
decimal point.
double Double precision 8 bytes +/- 1.7e +/- 308 (~15
floating point number. digits)
More accurate
compared to float.
long double Long double precision 8 bytes +/- 1.7e +/- 308 (~15
floating point number. digits)
Boolean Data Type
Data Type Description Size Typical Range
(Keywords)
bool Boolean value. It can only 1 byte true or false
take one of two values: true
or false.
C Keywords
asm else new this
auto enum operator throw
bool explicit private TRUE
break export protected try
case extern public typedef
catch FALSE register typeid
char float reinterpret_cast typename
class for return union
const friend short unsigned
const_cast goto signed using
continue if sizeof virtual
default inline static void
delete int static_cast volatile
do long struct wchar_t
double mutable switch while
dynamic_cast namespace template
In addition,
the following
words are
also
reserved:
And bitor not_eq xor
and_eq compl or xor_eq
bitand not or_eq
Functions Descriptions
abort stops the program
abs absolute value
acos arc cosine
asctime a textual version of the time
asin arc sine
assert stops the program if an expression isn't true
atan arc tangent
atan2 arc tangent, using signs to determine quadrants
sets a function to be called when the program
atexit
exits
atof converts a string to a double
atoi converts a string to an integer
atol converts a string to a long
bsearch perform a binary search
allocates and clears a two-dimensional chunk of
calloc
memory
ceil the smallest integer not less than a certain value
clearerr clears errors
returns the amount of time that the program has
clock
been running
cos cosine
cosh hyperbolic cosine
returns a specifically formatted version of the
ctime
time
difftime the difference between two times
div returns the quotient and remainder of a division
exit stop the program
exp returns "e" raised to a given power
fabs absolute value for floating-point numbers
fclose close a file
feof true if at the end-of-file
ferror checks for a file error
fflush writes the contents of the output buffer
fgetc get a character from a stream
fgetpos get the file position indicator
fgets get a string of characters from a stream
returns the largest integer not greater than a
floor
given value
fmod returns the remainder of a division
fopen open a file
fprintf print formatted output to a file
fputc write a character to a file
fputs write a string to a file
fread read from a file
returns previously allocated memory to the
free
operating system
freopen open an existing stream with a different name
frexp decomposes a number into scientific notation
fscanf read formatted input from a file
fseek move to a specific location in a file
fsetpos move to a specific location in a file
ftell returns the current file position indicator
fwrite write to a file
getc read a character from a file
getchar read a character from STDIN
getenv get environment information about a variable
gets read a string from STDIN
returns a pointer to the current Greenwich Mean
gmtime
Time
isalnum true if a character is alphanumeric
isalpha true if a character is alphabetic
iscntrl true if a character is a control character
isdigit true if a character is a digit
isgraph true if a character is a graphical character
islower true if a character is lowercase
isprint true if a character is a printing character
ispunct true if a character is punctuation
isspace true if a character is a space character
isupper true if a character is an uppercase character
itoa Convert a integer to a string
isxdigit true if a character is a hexadecimal character
labs absolute value for long integers
ldexp computes a number in scientific notation
returns the quotient and remainder of a division,
ldiv
in long integer form
localtime returns a pointer to the current time
log natural logarithm
log10 natural logarithm, in base 10
longjmp start execution at a certain point in the program
malloc allocates memory
searches an array for the first occurrence of a
memchr
character
memcmp compares two buffers
memcpy copies one buffer to another
memmove moves one buffer to another
memset fills a buffer with a character
mktime returns the calendar version of a given time
decomposes a number into integer and fractional
modf
parts
displays a string version of the current error to
perror
STDERR
pow returns a given number raised to another number
printf write formatted output to STDOUT
putc write a character to a stream
putchar write a character to STDOUT
puts write a string to STDOUT
qsort perform a quicksort
raise send a signal to the program
rand returns a pseudo-random number
realloc changes the size of previously allocated memory
remove erase a file
rename rename a file
move the file position indicator to the beginning
rewind
of a file
scanf read formatted input from STDIN
setbuf set the buffer for a specific stream
setjmp set execution to start at a certain point
setlocale sets the current locale
setvbuf set the buffer and size for a specific stream
signal register a function as a signal handler
sin sine
sinh hyperbolic sine
sprintf write formatted output to a buffer
sqrt square root
srand initialize the random number generator
sscanf read formatted input from a buffer
strcat concatenates two strings
finds the first occurrence of a character in a
strchr
string
strcmp compares two strings
compares two strings in accordance to the
strcoll
current locale
strcpy copies one string to another
strcspn searches one string for any characters in another
strerror returns a text version of a given error code
strftime returns individual elements of the date and time
strlen returns the length of a given string
concatenates a certain amount of characters of
strncat
two strings
compares a certain amount of characters of two
strncmp
strings
copies a certain amount of characters from one
strncpy
string to another
finds the first location of any character in one
strpbrk
string, in another string
finds the last occurrence of a character in a
strrchr
string
returns the length of a substring of characters of
strspn
a string
finds the first occurrence of a substring of
strstr
characters
strtod converts a string to a double
strtok finds the next token in a string
strtol converts a string to a long
strtoul converts a string to an unsigned long
converts a substring so that it can be used by
strxfrm
string comparison functions
system perform a system call
tan tangent
tanh hyperbolic tangent
time returns the current calendar time of the system
tmpfile return a pointer to a temporary file
tmpnam return a unique filename
tolower converts a character to lowercase
toupper converts a character to uppercase
ungetc puts a character back into a stream
va_arg use variable length parameter lists
write formatted output with variable argument
vprintf, vfprintf, and vsprintf
lists
vscanf, vfscanf, and vsscanf read formatted input with variable argument lists