0

Is their ANY way to do something like:

for (int x=1; x<3; x++) {string MyArray[1][x]={"-"};}

Assuming the array has already been defined? I really don't want to have to do:

MyArray[1]={blah}
MyArray[2]={blah}
MyArray[3]={blah}
etcetera etcetera

I'm not necessarily looking for efficiency but seriously, initializing 50 arrays looks very messy and ugly.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by AutoPython
0

Since it's already defined, you already have it, sort of. Just leave the keyword "string" out as well the inner brackets.

for (int x=1; x<3; x++) {MyArray[1][x]="-";}

This is a 2-D string array?

[EDIT]
Actually, I think you have to fill in the "blah", "etcetera", and the declaration so it's clear what you're trying to do.
[/EDIT]

Edited by VernonDozier: n/a

0

Actually, I think you have to fill in the "blah", "etcetera", and the declaration so it's clear what you're trying to do.

D:

I forgot what I was going to do... What will we do now?

Edited by AutoPython: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.