What is a memory leak?
Its an scenario where the program has lost a reference to an area in the memory. Its a programming term describing the loss of memory. This happens when the program allocates some memory but fails to return it to the system
Read the rest of this entry »How do you reverse a singly linked list? How do you reverse a doubly linked list? Write a C program to do the same.
This is THE most frequently asked interview question. The most!.
Singly linked lists
Here are a few C programs to reverse a singly linked list.
Method1 (Iterative)
#include
// Variables
typedef struct node
{
int value;
struct node *next;
}mynode;
// Globals (not required, though).
mynode *head, *tail, *temp;
// Functions
void add(int value);
void iterative_reverse();
void print_list();
// The main() function
int main()
{
[…]
What is a NULL pointer? How is it different from an unitialized pointer? How is a NULL pointer defined?
Home
What is a NULL pointer? How is it different from an unitialized pointer? How is a NULL pointer defined?
A null pointer simply means “I am not allocated yet!” and “I am not pointing to anything yet!”.
The C language definition states that for every available pointer type, there is a special value which is called […]
What is the difference between char *a and char a[]?
There is a lot of difference!
char a[] = “string”;
char *a = “string”;
The declaration char a[] asks for space for 7 characters and see that its known by the name “a”. In contrast, the declaration char *a, asks for a place that holds a pointer, to be known by the name “a”. This pointer “a” can […]
What are macros ?
This is one of more frequent questions that is asked. This was asked to me 2 times and both time, I messed it. I thought that I knew it but than still could not explain it properly.
First be clear on what is Preproessor which is a program that processes its input data to produce output […]

