answersLogoWhite

0

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; // legal
pi = 3; // illegal, this should generate a syntax error when you compile


return 0;
}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Who is constant in this polynomial X plus z plus y?

None of these are constants. All are variables.


What is the difference between name constant and literal constant in c plus plus programming?

a named constant is pretty much the same thing as a literal constant, except it is a name. both cannot change. literal constants are numbers, named constants are words. tada!


What is the GCF of the first two terms of the last two terms for the polynomial 2m3 plus 6m2 plus 3m plus 9?

The GCF of the coefficients and constants i 1. The GCF of the variables is also 1.


What does Correlation of plus 1.00 mean?

It mean that there is no correlation between the two variables. The variables are the same.


What are the differences between global variables and local variables in C plus plus?

Global variables can be seen in all blocks of your program, when local variables are visible only within the block where it's declared.


Is 7 plus 4 equals 11 an algebraic equation?

No, it is an arithmetic equation. There are no variables involved, only numeric constants and, as a result, most people would not consider it algebraic.


What is the constants of the expression -4 plus 11x plus 9 - 8x?

-4, 11, 9, and -8 are constants. 'x' is the variable.


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

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


4x plus 69 equals 30 plus 5x solve for x?

4x + 69 = 30 + 5xSeparate the variables and constants (subtract 4x from each side):69 = 30 + xSubtract 30 from each side (your variable is already a unit) :39 = x


What is the difference between pointers in c and c plus plus?

Nothing.


What is the difference between be plus ing and get plus ing?

There are no such terms in C++.


What is the difference between statements in c plus plus charconstp and char constp?

There is no difference. Both statements are invalid.