Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For loop problem
#5
(12-15-2009, 02:38 PM)Master of The Universe Wrote: Yes that is because you're declaring the x variable every time new.
To do what you want you'll need an array.

Code:
char[] x;
//then in the loop
x[i] = i;

I'm getting an error on the 'char[] x;', it says it expected primary expression before char.

Where exactley do I put this?

And sorry im pretty new to C++.
Reply


Messages In This Thread
For loop problem - by GeneralOJB - 12-15-2009, 02:12 PM
RE: For loop problem - by Gaijin - 12-15-2009, 02:20 PM
RE: For loop problem - by GeneralOJB - 12-15-2009, 02:35 PM
RE: For loop problem - by Gaijin - 12-15-2009, 02:38 PM
RE: For loop problem - by GeneralOJB - 12-15-2009, 02:48 PM
RE: For loop problem - by Gaijin - 12-15-2009, 04:14 PM
RE: For loop problem - by Brainless Control - 12-15-2009, 02:52 PM
RE: For loop problem - by GeneralOJB - 12-15-2009, 03:02 PM
RE: For loop problem - by Brainless Control - 12-15-2009, 03:13 PM
RE: For loop problem - by GeneralOJB - 12-17-2009, 03:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why doesn't this loop work? nevets04 5 1,392 12-11-2009, 03:38 AM
Last Post: Sagittarius

Forum Jump:


Users browsing this thread: 2 Guest(s)