Macros Vs Functions
Any computations that can be done on macros can also be done on functions. But there is a difference in implementations and in some cases it will be appropriate to use macros than function and vice versa.
Predefined names defined by preprocessor
_LINE_, _FILE_, _DATE_, _TIME_ and _STDC_identifiers defined by the preprocessor, and cannot be undefined or redefined.
Preprocessor Commands
In this tutorial we will discuss other preprocessor commands like #ifndef, #if, #else, #elif, #line and #pragma
What is the solution for dangling pointer problem?
In other word we can say a pointer whose pointing object has been deleted is called dangling pointer.
What is dangling pointer problem?
after free() also i keeps the address but content is deallocated.so now it is not pointing to any valid memory location.Hence ptr is now dangling pointer which probably having a address but not pointing to any valid memory location.
What is a dangling pointer?
A dangling pointer is a pointer to storage that is no longer allocated. Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory.
Can you give me an example for structure padding?
The size of structure ex is actually 5 but in c. it takes 8 bytes because sizeof pointer is 4 bytes . because of pointer traversing it takes multile of 4 bytes. if u want to remove structure padding use at a time of complisation.
What is Memory Leak?
A memory leak is a particular kind of unnecessary memory consumption by a computer program, where the program fails to release memory that is no longer needed.
What are the advantages and disadvantages of arrays in c?
Here we are discussing the advantages and disadvantages of arrays in c programming language.
What are Wild Pointers? How can we avoid them?
Uninitialized pointers are known as wild pointers because they point to some arbitrary memory location and may cause a program to crash or behave badly.
What is wild pointer in c ?
A pointer in c which has not been initialized is known as wild pointer.
Wild pointer
Wild pointer is a pointer that doesn’t point to either a valid object (of the indicated type, if applicable), or to a distinguished null value, if applicable.
What is size of void pointer ?
Size of any type of pointer in c is independent of data type which is pointer is pointing i.e. size of all type of pointer (near) in c is two byte either it is char pointer, double pointer, function pointer or null pointer.
How to swap two variables, without using third variable ?
There are many ways to swap two variables with out using a third variable. Here we are discussing a few of them.
Write a c program without using any semicolon which prints “Hello world”?
We can print hello world with our using semi colon in a c program by using if/while or switch.
keep looking »