I'm having trouble doing something like this...
void Enlarge(char *p)
{
char *x=new char[20];
delete[] p;
p=x;
}
void main()
{
char *sz=new char[10];
Enlarge(sz);
}
Using the debugger, it looks like p does get the address of x, but after
the function, sz is the same address, an empty string? Trying to do
it different, like this...
char *Enlarge(char *p)
{
char *x=new char[20];
delete[] p;
return x;
}
void main()
{
char *sz=new char[10];
sz=Enlarge(sz);
}
so far seems to work, but am I even on the right track?
L8r,
bw
--- Blue Wave/DOS v2.20
---------------
* Origin: River Canyon Rd. BBS Chattanooga, Tn (1:362/627)
|