I promise I tried to look this up before I came to ask you guys, but the resources I found never answered the question.... Is it unusual for a variable made in a function to be invisible to another code block in the same function? I use Dev C++ and that is what seems to be happening.

for example:

int main()
{
    int a = 0;
.
.
.
    while (something)
        {
            .
            .
            a += 1; /*compiler says variable is undeclared*/
        }
.
.
.
}

I would probably suggest that you have mis-matched braces, and that you don't have the scope you think you have.

A small and COMPLETE compilable example would be a lot better than the .... abbreviation you've posted.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.