what is the difference between declaration ,defenetion and
initialization of a variable?

Answer Posted / prakash

Declaration: int a;(does not allocate memory)
Initialisation: a=5;(value is assigned for 'a')
Definition: int a=5;(allocates memory)

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between %d and %i?

592


What are the 5 organizational structures?

567


How can I open a file so that other programs can update it at the same time?

655


What is sizeof in c?

571


Are the variables argc and argv are local to main?

787






What is difference between structure and union in c programming?

565


Why is main function so important?

611


Why is c known as a mother language?

740


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

669


What is printf () in c?

578


How many types of operators are there in c?

613


Why static variable is used in c?

550


What is volatile variable how do you declare it?

562


What is #define in c?

615


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2171