Posted by Niklas Olsson on 1998-03-12
do like thisprivate:
int* m_values;
and then you can just use
new and delete..
like
m_values = new int[a new value];
Niklas
> Subject: C++ Help
>
> Hi!
>
> I am a Visual Basic programmer now learning C++. I am trying to create a
> stack class, and for this, I need to be able to dynamically redimension a
> member array. Currently, I use the following code, but this simply limits
> the array to 100 items:
>
> const int MaxItems = 100;
> ......
> private:
> int m_values[MaxItems]; // Array of stacked values
> int m_count; // Number of items in stack
> };
>
> I would be extremely grateful if anybody could show me a way to increase the
> size of m_values at runtime.
>
> From.
>
> Christopher Waudby
> quadby@xxxxxxxxx.xxx
> http://freespace.virgin.net/c.waudby/
>
> ------------------------------
>
> Date: Thu, 12 Mar 1998 10:34:24 +1000
> From: "Renegade" <aseng@xx.xxx.xx>
> Subject: Re: TCG digest 82
>
> -----Original Message-----
> From: tcg@xxxx.xx.xx <tcg@xxxx.xx.xx>
> To: aseng@xx.xxx.xx <aseng@xx.xxx.xx>
> Date: Wednesday, March 11, 1998 12:01 PM
> Subject: TCG digest 82
>
> Could somebody please help me out here.
> I am in urgent need of source for file handling .
> This is what I need it to do.
>
> 1). To show only certain files of my choosing. Eg:showfiles('*.txt *.pas
> *.lst *.tpu *.bgi',5, 2,20,24,shadowon)
>
> 2). directories and files to be sorted in alphabetical order.
>
> 3). Tagging abilities.
>
> 4). Text mode.. 80x50
>
> 5). Miniumn of 1024 files per directory.
>
> Anyhelp would be greatly appreciated..
>
> Regards Andrew.......
>
> ------------------------------
> >
Previous post | Next post | Timeline | Home