Hi , I have a problem when compile following code:
for(int i=0;i<curConnections.size();++i)
{
if (curConnections.at(i).Descriptor()==connName)
{
curConnections.at(i).sendCmd(cmd);
break;
}
}
for(int i=0;i<curConnections.size();++i)
{
if (curConnections.at(i).Descriptor()==connName)
{
curConnections.at(i).sendCmd(cmd);
break;
}
}
To copy to clipboard, switch view to plain text mode
Compiler complains:
error: passing 'const ConnConnection' as 'this' argument of 'void ConnConnection::sendCmd(const QString&)' discards qualifiers
Then I use following it compiles OK.
curConnections[i].sendCmd(cmd);
curConnections[i].sendCmd(cmd);
To copy to clipboard, switch view to plain text mode
I am not quite get what's the difference of these 2 lines of code.
Bookmarks