C
C#3y ago
4

how i can write words in arrays [Answered]

i wanna write words after numbers
17 Replies
Mango
Mango3y ago
@cupck Are you trying to write something like this in a file 1) Sentence
4
4OP3y ago
yea
Mango
Mango3y ago
What results are you seeing when you test your code
4
4OP3y ago
Mango
Mango3y ago
So this is saying that i is either greater than or equal to the length of the array Array indices (which i is an index here) start at 0, so the max index you can have is the length minus 1 Look at your for statement
4
4OP3y ago
one minute pls
4
4OP3y ago
4
4OP3y ago
like this ?
Mango
Mango3y ago
Not quite Better though Your index i can still be equal to the length of the array, the max index is length - 1
4
4OP3y ago
omg it worked im so happy thank you very much
Mango
Mango3y ago
Did you remove the = sign?
4
4OP3y ago
yes
Mango
Mango3y ago
Perfect Then your output formatting doesn't matter, can write i+1 if you want in the stream writer so it starts at 1
4
4OP3y ago
yea i got it thank again
Mango
Mango3y ago
No problem
4
4OP3y ago
i never forget u you save my life I've been trying to fix this for two days
Accord
Accord3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server