I'm new to c++, and therefore hope my question isn't too stupid, but it is quite blocking, and I've looked around and failed to find an answer...
I'm blocked on the definition of a variable with its value inside parentheses, like in this simple example :
int main()
{
int x(0);
}
It doesn't work when I try it, nor does this :
int x=0;
Xcode tells me the variable is "unused", and I have to add a line like this to make it work :
int x;
x=0;
I'd ignored this minor problem after trying in vain to find a solution. But it appears to be more crippling than I thought at first, for example when trying to reference a variable to another, since neither:
int& y(x);
nor:
int& y;
y = x;
works. I've tried several combinations but I guess there is something here I really don't get, even though it's really basic; so, I would be very grateful if someone could help !
Thank you very much !