Original Post
Ok, i have a class called TCPCLIENT and i have done this:
TCPCLIENT *tcpClient;
tcpClient=new TCPCLIENT;
And that works fine. But when i try this:
TCPCLIENT *tcpClient;
tcpClient=(TCPCLIENT *)malloc(sizeof(TCPCLIENT));
my program gets an error and quits as soon as i try to access tcpClient. I don''t have a constructor for TCPCLIENT, so i was wondering why the different calls even make a difference. I was told that new is just runs the constructor and then basically does malloc. BTW, TCPCLIENT is derived from CLIENT, which also has no constructor.
Any ideas?