array of pointers to QtcpSocket
Sorry for posting this!
The problem was that I didn't spell QTcpSocket with the large T..
Regards
Hi all,
I want to change my program from connecting to one server to several servers at the the same time. I have declared an array of pointers of type QtcpSocket instead of one pointer.
Code:
QtcpSocket *tcpSocket[2];
tcpSocket[0]=new QtcpSocket(this);
tcpSocket[1]=new QtcpSocket(this);
the code gives the following error-messages:
Quote:
error :expected type-specifier before ‘QtcpSocket’.
error: cannot convert ‘int*’ to ‘QTcpSocket*’ in assignment
error: expected before ‘;’ before ‘QtcpSocket’
I have also tried *tcpSocket[0]=new QtcpSocket(this);
I could declare two QtcpSocket pointers instead, but an array of pointers would be more convenient.
Thanks, any help is deeply appreciated!
Regards