Strange for loop error using arrays

I came across a strange error tonight writing a simple for loop in code::blocks. This function returns true if the input does not match the good characters, but im getting the following error:
F:\2DimMap(CONSOLE)\v1.09a\Player.cpp||In function 'bool Badinput(char)':|
F:\2DimMap(CONSOLE)\v1.09a\Player.cpp|20|error: name lookup of 'i' changed for ISO 'for' scoping|
F:\2DimMap(CONSOLE)\v1.09a\Player.cpp|20|note: (if you use '-fpermissive' G++ will accept your code)|


the code:
1
2
3
4
5
6
7
8
9
10
11
bool Player::Badinput(char x)
{
    char input[5] = {'w','s','a','d','g'};
    for(int i = 0; i < 5;i++);
    {
        if(x == input[i])
            return false;
    }
    return true;
}


thing you might need to know:
I use windows
the code is apart of a much large game i've been working on.
The problem may be that you have a ";" at the end of your "for" line
wow, what a dumb mistake lol. I think ill have to get some rest for tonight, thank you so much!
Topic archived. No new replies allowed.