Categories
C

What is Command Line Argument in C

COMMAND LINE ARGUMENT:- Command line argument in C is a mechanism by which a program takes input during runtime. The main function takes two parameters in a command line argument such as Argument Counter:- It counts the number of argument on the command line. Argument Vector:- Is a pointer array which points to each argument […]

Categories
C

File Handling in C

FILE HANDLING IN C:- File & Directory:- File is a mechanism which stores data and Directory is a mechanism which stores file. Types of File:- Regular File Directory FIle FIFO File Socket File Link File Character special File Block special File The maximum size of the file depends upon the file system such as Windows:- […]

Categories
C

Structure and Union in C

Structure and Union:- Structure:- Structure is a mechanism which groups different data member to form a record. A structure is suitable for creating a database memory link and link list and creating bit-field. Basically, structure is used to defines as a record. Syntax:- struct [structure name] { member definition; member definition; … member definition; }; […]

Categories
C

Preprocessor Directives in C

Preprocessor Directives in C:- The c preprocessor is known as CPP is a macro processor that is used automatic call by the compiler to transform your program before compilation. Macro is a symbolic name of expression. Different type of pre-processor directive:- i)macro expansion: #define, #undef ii)File inclusion directive: #include iii)Conditional directive: #if,#else,#endif,#elif, #ifdef, #ifndef iv)Miscellaneous directive: #pragma All […]

Categories
C

Storage Class in C

Storage Class in C:- Every c program has a storage class and a scope. The storage class is a data structure that decides the scope, storage default initial value, and life of variable function. Different types of scope and rules present in c:- Program scope File scope Function scope Block scope Program scope:- If a […]

Categories
C

Function in C

Function in C:- A function is a set of statements that are encapsulated together to perform a particular task. There are basically 3 types of function:- User-defined function Standard Library function System Calls User-defined function:- When the library function is not sufficient enough to solve the current problem then immediately the developer writes the code […]

Categories
C

Dynamic Memory Allocation

Dynamic Memory Allocation:- Every program allocates memory during the runtime and load time, but how much memory will be allocated during the runtime is called dynamic memory allocation. If the size is decided during the compile time only that called static memory allocation. Entire 4GB memory is split into two parts such as lower 3GB […]

Categories
C

String in C

String in C:- A string in C is a character array terminated with a null character. All the string are character array but all the character array is not a string. main() {             char p[]={‘a’,’b’,’c’,’d’};             char q[]={‘a’,’b’,’c’,’d’,’\0’}; } Here p is a character array and q is a string. Anything is written within […]

Categories
C

Pointer in C

Pointer in C:- A pointer in C is a variable which refers only address. (address is a location in memory). Pointer is 4byte because an address is a 4 byte long. Pointer cannot refers any address beyond 4GB of memory in GCC compiler. APPLICATION OF THE POINTER:- It is used for dynamic memory allocation and […]

Categories
C

Array in C

Array in C:- Array in C  is a variable that can hold more than one similar type of element. It is sequential in nature. Array index starts from zero which is known as the lower boundary of an array. Array upper boundary is (Array size-1). To access each element of array called traversing of the […]

Categories
C

Control Structure in C

CONTROL STRUCTURE:- Hanging if is not allowed in C language. If a statement is used for checking range and yes/no problem. else is the optional part of the if. Execution of the switch case starts from the match case. Use break to prevent the falling of control from one case to another case. If none […]

Categories
C

Operator in C

Operator in C:- Operator in C :- 1) Precedence and associativity of an operator only implemented if it is represented in INFIX notation. Precedence decides which operation will be performed first. Associativity decides the order of evaluation ( left to right or right to left) if more than one operator enjoy the same precedence. The […]

Categories
C

DataType in C

Datatype in C:- Data type Size (Bytes) Range Format Specifiers Char 1 – 128 to 127 %c Unsigned char 1 0 to 255 %c Short or int 2 – 32,768 to z32, 767 %i or %d Unsigned int 2 0 to 655355 %u Float 4 3.4e – 38 to +3.4e +38 %f or %g Long […]

Categories
C

Structure Of  C Program

STRUCTURE OF C PROGRAM:- In this post, we will learn about the Structure Of  C Program. Following are the basic Structure Of  C Program Include header file section Global declaration section main() { Declaration statement Executable statement } User-defined functions { Statements } Include Header File Section C program always depends upon some header files […]

Categories
C

Interesting facts about C Program

Interesting facts about C Program:- The Interesting facts about C Program are When you purchase a computer directly from the manufacturer, is like a dead body, and one has to give life to it, by feeding something ( software) to enable it to perform the desired function, that specific software is designed in C language. If you […]