answersLogoWhite

0

What is syntax in c plus plus for declaring a variable?

Updated: 8/19/2019
User Avatar

Wiki User

13y ago

Best Answer

type variable {[optional array size]} {= optional initializer};

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is syntax in c plus plus for declaring a variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How you declare a variable in c language?

you have to give a statement in the following syntax datatype variable;


Is the syntax between c and c plus plus different?

Yes


What is constant variable in c?

Constant variables refers to those variables whose values cannot be changed. These variables should be initialized along with their declaration. Attempt to change the value of a constant variable will generate compile error. The syntax for declaring a constant variable is:const data-type variableName = value;


What is different of c language and c plus plus?

Primarily OOP support, but there are minor syntax difference. By and large anything you can do in C you can also do in C++.


What is extension part of c plus plus?

C++ Extension Name is... Syntax is: File Name.extension name. Ex: ankit.cpp


What is the syntax of printing a value in c plus plus?

std::cout<<42<<std::endl;


What does a constant do in c plus plus?

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


How do you increment hex value in c?

First a variable in numeric data type is to be defined. Then increment the number using the ++ command syntax of C,


Difference between variables and constants in C plus plus?

A constant variable cannot be changed after it is initialized, whereas a normal variable can.ex:int main(){const float pi = 3.14159;int non_const = 0;non_const = 42; // legalpi = 3; // illegal, this should generate a syntax error when you compilereturn 0;}


What did C plus plus add to the C language?

Object-oriented programming principals, a more consistent syntax and improved type-safety.


Bagian syntax yang di gunakan c plus plus?

C++ uses a syntax that is exactly the same as in C, with the addition of reserved words that are specific to C++. C ++ menggunakan sintaks yang persis sama seperti di C , dengan penambahan kata-kata reserved yang khusus untuk C++.


What is the syntax of c plus plus?

The answer is really beyond the scope of this site. You would probably need to buy a textbook.