Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW do you create a user defined array ????????

Status
Not open for further replies.

richsb

Technical User
Aug 2, 2001
34
NO
Hi Folks,

New to programming, so excuse if this is simple !

I want to be able to have a multi-dimensional array which is defined by the user. i.e. they input the number of dimensions used e.g. 1,2,3 or 4, and also input the size of the array e.g. 10 rows, 20 columns etc.
I see from the 'help' that it is explained that dynamic arrays are catered for by assigning a constant to it, which kind of defeats the point !!!!

Any ideas ?

Thanks in advance
 
struct xxx //xxx you'll use as data type (int, char, char* ...)
{
int x;
char y[100];
char* z;
int read_x(){return x;}
.....
};

ind using it:

xxx a;
a.x = 10;
int z=a.read_x()
strcpy(a.y,"hello world");
a.z=(char*)a.y;
... John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top