PsyVision
Mar 20th, 2002, 04:17 PM
I dunno if thats what its called but, heres what i need to do, when i try it i keep getting erros to do with memory and stuff not working properly.
I have a class:
class Connection {
public:
int socket;
};
I then need to have an array of this which can be set at run time, ie i can have 10 connections or 2. this is what i tried;
int amount = 10;
Connection *conn;
delete [] conn;
conn = new Connection[amount];
Should that work ? or is it all wrong ?
I have a class:
class Connection {
public:
int socket;
};
I then need to have an array of this which can be set at run time, ie i can have 10 connections or 2. this is what i tried;
int amount = 10;
Connection *conn;
delete [] conn;
conn = new Connection[amount];
Should that work ? or is it all wrong ?