J
JNY
Hello,
Is it possible to declare an array with variable indeces?
i.e.
int x = 4;
int myArray[x];
for (j = 0;j < 5;j++)
{
myArray[j] = j;
}
x = 5;
for (j = 0;j < 6;j++)
{
myArray[j] = j;
}
If it is possible I may have to use pointers, but I'm not sure how,
and searching this group didn't come up with any answers. If anyone
knows, I'd grately appreciate their ideas.
Cheers,
JNY
Is it possible to declare an array with variable indeces?
i.e.
int x = 4;
int myArray[x];
for (j = 0;j < 5;j++)
{
myArray[j] = j;
}
x = 5;
for (j = 0;j < 6;j++)
{
myArray[j] = j;
}
If it is possible I may have to use pointers, but I'm not sure how,
and searching this group didn't come up with any answers. If anyone
knows, I'd grately appreciate their ideas.
Cheers,
JNY