I hope someone can help clear this up for me.

If I use this I get an error:

int i = GetInt();


I get an error... but if I use this it works:

int i;
i = GetInt();


Any help is much appreciated.

  • would help to know what the errors say! – kzidane Nov 6 '15 at 18:34
  • It's impossible to answer because the code works both ways. There must be something else going on in another part of the code that is causing your problem. Can you please edit your question and add the surrounding code along with a description of the problem, the symptoms and the errors? – Cliff B Nov 7 '15 at 1:07

You must log in to answer this question.

Browse other questions tagged .