answersLogoWhite

0


Best Answer

I don't know what your code looks like since you haven't actually provided any, but the compiler is telling you that you are trying to use an identifier that is not in scope. You may or may not have declared the identifier, but if it is not in scope then it is effectively undeclared. The following example illustrates this:

for(int i=0; i<10; ++i)

std::cout<<i<<std::endl;

i=i+1; // ERROR: Undeclared identifier. i is no longer in scope

To resolve this problem, we must move the declaration of i outside of the loop, thus making it accessible both inside and outside of the loop:

int i;

for(i=0; i<10; ++i)

std::cout<<i<<std::endl;

i=i+1; // OK

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In C plus plus I want to use an if statement so if the word in a char array is lets say hi it will perform an operation but what it does is says undeclared identifier please explain in simple manner?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Explain goto and return in c?

A return statement is used to transfer the program control flow to the function that has called the current function under execution. If the function is main, then the program returns the control flow to the operating system. The syntax for return statement is:return return-type;A goto statement is used to transfer the control flow to a particular labelled statement, not necessarily back to the calling program. There are somerestrictionson using a goto statement. For eg: the goto statement should not skip any variable declarations. The use of goto statement is usually considered as a bad programming practice. The syntax for goto statement is:goto label_name;....label_name: statements;


Explain all the control statements in java?

The if and switch statements are commonly referred to as decision statements. When we use decision statements in our program, we're asking the program to evaluate a given expression to determine which course of action to take. It decides the control flow of the program.


Binding is a concept in programming languages explain this concept with special reference to Pascal Ada and C language?

in a general sense, a Binding is an association,such as between an attribute and an entity or between an operation and a symbol.


What are the Limitations of algorithms?

it can not explain all the details of the given problem........ it has no standard rule to solve any operation , different users use their own point of views......


Explain the term identifier in java?

Identifiers are the strings you use in Java source code to identify unique things, such as variables, classes, and methods. Identifiers may be any word beginning with a letter or underscore, and continuing with letters, numbers, and underscores. Identifiers are case sensitive.