What is the difference between declaration and definition?

Answer Posted / sanjay

The definition is the one that actually allocates space,
and provides an initialization value, if any.
There can be many declarations, but there must be exactly
one definition. A definition tells the compiler to set
aside storage for the variable. A declaration makes the
variable known to parts of the program that may wish to use
it. A variable might be defined and declared in the same
statement

Is This Answer Correct ?    57 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is different between oops and c++

2004


program for insertion ,deletion,sorting in double link list

2285


What are the 4 pillars of oop?

674


What is basic concept of oop?

702


What is polymorphism oop?

623






Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

2578


What are benefits of oop?

641


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

1643


what are the different types of qualifier in java?

1847


What is the benefit of oop?

570


What do you mean by variable?

577


Is react oop?

614


How do you achieve runtime polymorphism?

573


#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2070


What are constructors in oop?

598