0

can someone show me an example of how you would initiate a variable and how you would fix a undeclaired identifiers.

i am a visual learner so thats why i ask for an example.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Jiwe
1

>>can someone show me an example of how you would initiate a variable.

int variable = 0; //declare and initialize the variables

>>how you would fix a undeclaired identifiers.

an undeclaried identifier means that you used a variables that has not
been declared. For example :

int n = 1;
int m = 2;
sum = n + m; //error indeclared identifier

The way to solve this problem is to declare the variable. In the above
code, you need to declare the variable sum. So the correct code should be :

int n = 1;
int m = 2;
int sum = n + m; //notice the "int sum" part. Thats the declaring the variable part.
0

Initializing a variable:

char Test = "Initialized";

Declare a variable:

int Declared;

Undeclared variable:

Undeclared;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.