What is the difference between null pointer and the void
pointer?

Answers were Sorted based on User's Feedback



What is the difference between null pointer and the void pointer?..

Answer / vignesh1988i

NULL POINTER:
this pointer returns null value to the main function......
it cant be type casted.........

VOID POINTER:
this pointer has a special advantages that it can point
to any value (int , char, float etc) when its type casted

for eg:
main()
{
char *p;
int n;
(int *)p=&n;
so on the above character pointer is been type casted to
point an integer value n;

Is This Answer Correct ?    11 Yes 3 No

What is the difference between null pointer and the void pointer?..

Answer / sunitha

null pointer : used to compair a pointer to any object or
a function and returns a null value to the main function.

void pointer : void pointer ia pointer which does not have
any return type and it can be easily type casted with other
type of pointers.

Is This Answer Correct ?    1 Yes 0 No

What is the difference between null pointer and the void pointer?..

Answer / vaibhav

null pointer contain null value . it doesn't contain any
value.
while void pointer is a pointer that cascade at a runtime.
i.e it casting at runtime

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Interview Questions

1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

0 Answers   TCS,


Write a c program to sort six numbers and find the largest one by using the ladder of if-else? plz do help me

2 Answers  


CAN ANYONE PLEASE HELP ON THIS PROGRAM FOR MY EXAM..TQ Write a C program to help a H’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the H’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the H’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80 Your program must do the following task below: a. Define the data structs, menu item types with two components: menu item of type string and menu price of type double. Use an array to declare the data structs. b. Function get data to loads the data into the array menu list. c. Function show menu to show the different breakfast items offered by the restaurant and tell the user how to select the items. d. Function print receipt to calculates and prints the customer receipt. The billing amount should include a 5% tax. e. Format your output with two decimal places. The name of each item in the output must be left-justify. You may assume that the user selects only one item of a particular type. f. The two sample output as shown: Welcome to HiFi’s Restaurant 1 Bacon and Egg $3.45 1 Muffin $2.20 1 Coffee $1.50 Tax 5% $0.35 Amount Due $7.50

1 Answers  


write a c program to convert fahrenheit to celsius?

4 Answers   TCS,


List the variables are used for writing doubly linked list program.

0 Answers   Infosys, Wipro,


What are Macros? What are its advantages and disadvantages?

0 Answers   TCS,


What is wrong with this code such that it doesnt produce the input reversed? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char Space = ' '; char LineOfText; float count; LineOfText = getchar(); while ((LineOfText = getchar()) != '/n'); { count = strlen(LineOfText) - 1; while (count >= 0) { putchar(LineOfText[count]); count--; } } getchar(); return 0; }

2 Answers  


Explain what does it mean when a pointer is used in an if statement?

0 Answers  


what is the diff b/w static and non static variables in C. Give some examples plz.

3 Answers   Wipro,


Why we use break in c?

0 Answers  


why we are using float in C

4 Answers  


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

8 Answers   Aspire,


Categories