Forums Register Login

int[1000]

+Pie Number of slices to send: Send
I have a program with an array of integers defined like so:

int[] thenumber = new int[1000];

Now, I am trying to use a specific one of those number designated in a loop like so:

while (thenumber[i] >= 10)
{
...
...
}

When I try to compile I get an error that says "']' expected" on the line of the "while" statment... why would this be, and what do I need to change to fix it? Thanks for any help!
+Pie Number of slices to send: Send
The code you gave here looks fine. I would guess that the actual problem occurs in the lines previous to your while loop. Can you post the whole method that contains this loop?

Thanks,

Layne
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1078 times.
Similar Threads
Finding a prime factor
number to text convertion
Pulling Integer Values from a String
Where to ask questions about cattledrive assignments?
NumberFormatException
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:58:17.