Cpallini answered part of the question; but I am curious as to why you wrote the code this way. Are you just learning C++? Just experimenting with 'new' and 'delete'? Or is there some other reason?
#include <vector>
void do_something_1()
{
licenseClientData temp;
temp.clientData = new licenseClient*[3];
temp.iCount = 0;
temp.iCount--;
delete temp.clientData[temp.iCount];
temp.iCount--;
delete temp.clientData[temp.iCount];
temp.iCount--;
delete temp.clientData[temp.iCount];
delete [] temp.clientData;
getch();
return 0;
}
void do_something_2()
{
std::vector<SOCKET> licenseClient(3,(SOCKET()));
}
void do_something_3()
{
std::vector<SOCKET> licenseClient;
licenseClient.push_back((SOCKET()));
licenseClient.push_back((SOCKET()));
licenseClient.push_back((SOCKET()));
}
void do_something_4()
{
SOCKET licenseClient[3] = {SOCKET(), SOCKET(), SOCKET()};
}
Note that use of 'new' and 'delete' is rarely required – unless you are going to pass the pointer around or you need the object to have a longer life-time.
Sorry about all the edits - but to editor keeps messing up my code.