During the linker stage, the system has multiple object files to combine and it may be a possibility that some functions might have the same addresses so relocation or changing these addressing during combining the object file is called Static reallocation.
Sunday, June 16, 2024
Wednesday, June 5, 2024
MultiLine Macros in C
Tuesday, June 4, 2024
Toggle a bit in C using XOR
Sunday, June 2, 2024
What is Stack overflow
If a program accesses a memory beyond the available limit then a stack overflow occurs and the program gets terminated
Saturday, June 1, 2024
C Language Interview Question:What is the use of "##" operator in C
#include <stdio.h>
#define concat(a, b) a##b
int main(void)
{
int yx =7;
printf("%d\n", concat(y, x));
printf("%d\n", concat(3, 2));
return 0;
}
OUTPUT
7
32
EXPLAINATION
the ## operator will concatinate the parameters passed to the macro
In the first case
concat(y, x) - the macro will output yx and pass its value to printf as yx is treated as a variable by printf
In the second case
concat(3, 2) - the macro will output 32 and printf will print 32 as its treated as an integer
Wednesday, May 29, 2024
What is Segmentation fault
Segmentation fault is a runtime fault caused due to invalid memory accesses
Segmentation fault can be caused in the following scenarios:
1. When a pointer points to an invalid address
2. When a program tries to access a read-only memory section
3. Freeing a memory which is already freed in the past
Friday, May 24, 2024
C controls- what is the output
void main()
{
int a = 2 ;
float b = 2.0;
if (a == b)
printf("Hi");
}
OUTPUT
Hi
Explaination
the variable a is type casted to float before comparison
What is the difference between sexual and asexual reproduction?
Ans: Sexual reproduction takes place by the fusion of two sex cells ( gamates ) that is male and female. Asexual reproduction is a type of r...
-
Ans : Flowering plants of some species like Asteraceae and grasses , produce seeds without fertilization called Apomixis. It is a form of as...
-
when you write an embedded software around the Hardware libraries without RTOS.
-
The endocrine glands do not have ducts to secrete their hormones so they are called ductless glands. They release hormones directly into t...