Top Answer
User Avatar
Wiki User
Answered 2013-07-08 16:20:30

There is no difference, other than that declarations in C++ can also initialise the variable in a single instruction.

C example:

int x; // declaration

x=5; // initialisation

C++ example:

int y=5; // declaration and initialisation combined.

User Avatar

Your Answer

Related Questions

A declaration is an incomplete type whereas a definition is a complete type.

Both ++you and you++ have the same ending result. The variable you is incremented. The difference is that, if you use the combination in a larger expression, then you++ will have the initial value of you, while ++you has the incremented value of you.

An array is a collection of objects of similar data type ,whereas pointers are variable which is used to hold the address of the other variable.

An attribute is a class member variable while a behaviour is a class member method.

Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10

No., If you want to declare you jus use _ in between so the declaration will be like int seg_no;

If you define a variable inside of your function, the variable can be referred and used only inside of that function. It means that you will not able to use the variable in another function (including main). Area of code where your variable can be used after declaration is usually called visibility of the variable.

Declare the type (int, char, double, etc) followed by the name of the variable. The variable name is a reference to the memory allocated to the type being declared. If the variable is a pointer to the type, precede the name with *. In C++, you may also initialise variables in the declaration.

This is used in languages such as C, C++ and Java. The difference is when the statement is executed. If placed before the variable, the increment is done before other operations, otherwise, after them. This is best shown in an example.a + b++ means to add first, then to increment the variable b.a + ++b means to increment b first, then to do the addition.Similarly, in a = b++, b is copied to a, and then increment; while in a = ++b, variable b is incremented before being copied.

What is the difference between private stafford and plus student loans?

Nowadays it is the same thing. Long long time ago the following form was also acceptable as function declaration:FILE *fopen ();Currently it is:FILE *from (const char *, const char *);

#include func_1(...); var2 = 0;//global variable which is visible for func_1 as well as main(){...double var = 0.0;//local variable which is visible only inside of main...}int func_1(...){ var1 = 0;//local variable which is visible only inside of func_1}

what is the difference between message passing and dynamic binding

// for definition of enumerated type: enum [tag] [: type] {enum-list} [declarator]; // for declaration of variable of type tag: enum tag declarator;

C++ is a strongly-typed language, thus every variable, constant and function must have an explicit type declaration.

A variable is a named memory location for which the contents are volatile. The antonym of variable is constant.

VC++ is Microsoft's implementation of C++.

Everything. Actually, there is no similarity between the two.

What is the variable of x plus 10 plus 4x-35?

There is no difference; to define an object in C++ you use the 'class' definition

A constant is a variable that does not change. The correct term is constant variable.

Use a character variable. For example: plus = '+' minus = '-' You can now refer to these symbols using the variable names "plus" or "minus".

Copyright ยฉ 2021 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.