Operators in C

May 14, 2021 0 Comments

Operators in C Arithmetic Operators:   The binary arithmetic operators are +, -, *, /, and the modulus operator %. The % operator cannot be applied to a float or double. Relational Operators:  Relation operators check the relation between two operands. If the relation is true, it returns 1 or it returns 0. The relational operators are  >,  …

Share This:

Preprocessor Directives in c

May 14, 2021 0 Comments

 Preprocessor Directives in c, pre-processor instruction call as ‘directives’, directives always start with ‘#’ 1. Macro:  Macros are symbolic names give to a constant. At the stage of Preprocessor, macros replace with their definitions. There are two types of Macros. Syntax: #define MACRO_NAME Definition 1. object-like macros: The object-like macros look like a constant. They …

Share This:

Memory Segments in C

May 10, 2021 0 Comments

Memory Segments in C, There are different types of memory segments in the userspace. 1. Text segment:  text segment will store all the instructions which are part of the program. 2. Stack:  stack segment is used to store all local variables and is used for passing arguments to the functions along with the return address of …

Share This:

Storage classes in C (Auto, Register, Static, Extern)

May 10, 2021 0 Comments

Storage classes in C, There are four different storage classes 1. auto:  This is the default storage class for all local variables.             int a;             auto int b; the above are both variables in the same storage class.            example.c     2. register:  The register storage …

Share This:

How to Create a Library in C

May 9, 2021 0 Comments

How to Create a Library in C, Executables can be created in two ways 1. Static:  They contain fully resolve library functions that physically link to the executable images during building. creating static libraries: 1. Implement library source files. 2. compile and generate relocatable files. gcc add.c -o add.o gcc sub.c -o sub.o 3. use …

Share This:

C Program Compilation Stages

May 9, 2021 0 Comments

C Program Compilation Stages, There are 4 stages of the compilation process. 1. pre-processor:  C Program Compilation Stages, The job of the pre-processor is to take source files as input and pre-processor file example.i produced. If we go through the example.i file we will notice that stdio.h header file will be replaced with its full code.    …

Share This:

C Interview question and answers

May 8, 2021 0 Comments

C Interview question and answers 1. What are the memory segments in C? Ans: There are different types of memory segments in userspace.     1. Text segment: text segment will store all the instructions which are part of the program.     2. Stack: stack segment is used to store all local variables and is used for …

Share This: