If I wanted to declare a large number of variables that were all similar, for example:

var x1;
var x2;
var x3;
var x4;
var x5;
var x6;
var x7;
var x8;
var x9;
var x10;
var x11;

...etc

Is there a faster way to do that? Maybe something with loops?

Recommended Answers

All 4 Replies

Array perhaps?

Array perhaps?

is it possible to make an array of variables?

is it possible to make an array of variables?

Its not only possible, its also possible to make an arrays of arrays of arrays of pointers to an arrays of arrays that takes values.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.