ok this is all nested in a function that is a member of a class, the variable is declared within the function, and when trying to use it in a for loop (also in the same function), it gave me an error. So, I had to use a pointer.
I was wondering, whether this had to do with the function being a member of a class or do you always need pointers when dealing with for loops.
class Foo
{
void Bar()
{
float x;
for(int i =0; i< 5; i++)
{
x = i; // Warning C4244: '=' : conversion from 'int' to 'float',
// possible loss of data
}
}
};