last minute c examtray
A Preprocessor in a C programming language is a Program that processes source code of a C program, expanding Macro Definitions, File Inclusions and more.
Only through Preprocessor directives, you are able to include library files in your C program.
Preprocessing in C happens before compilation. Part of the Source code is replaced with Preprocessing expressions where ever encountered. So the size of Total code increases before passing to the Compiler.
C Programming language provides Console IO functions and Format Specifiers to help programmers Read and Write data.
C Format Specifiers and Console IO Functions
There are two types of Input Output Functions.
- Console IO
- File IO
1. Console IO functions help to read data from Keyboard and Print / Display data to the Monitor.
2. File IO functions help to read data from Files on Disk and Write data to the Disk.
A C language Structure is a user define data type used to combine similar or different data types as one single entity.
An int variable contains only integer data. A float variable contains only real number data. But a structure can be defined to hold multiple type data and refer to the elements separately.
String is just like an array of elements of character (char) data type. Every valid string in c programming language must end with a NULL character or '\0'. ASCII value of a NULL character is 48. Without null character at the end, array is just an array of characters but not STRING.
C Strings and Character Arrays
C language provide 'char' data type to hold Alphabets and Special characters. Size of a single character is 1 Byte.
An Array is a group of elements of same data type. C Programming Language allows programmers to deal with maintainability of a C program with tens of hundreds of variables used for a specific purpose.
C Programming Arrays and Pointers
An Array can be thought of as Single Row of Chairs in a Cinema Theater. Each row has a Number. Also, each Chair in that row has a number.
C language is built up of a number of functions. A function is a group of statements or block of statements that servers a specific purpose.
There are two types of functions in a C language.
- Library Functions
- User Defined Functions
1. Library Functions
C language provides IF, ELSE IF and ELSE conditional statements to suit various programming needs. Using so many if-else statements look clumsy some times. So, C language an alternative to if-else i.e SWITCH CASE.
Keywords used to implement a SWITCH CASE are switch, case, break and default.