I have the following code where I try to insert randomValue into an URL.
int randomValue = qrand() % 100;
view = new QWebView(this) ;
view->load(QUrl("http://blogsearch.google.com/blogsearch?q=C&start="+randomValue+"&num=1&output=rss"));
The following error is reported:
error: invalid operands of types ‘const char*’ and ‘const char [18]’ to binary ‘operator+’
So, I want to append the randomValue into the URL. How do I do it?
Use QString for this. It is far more capable than std::string and it provides what you need directly.
See QString documentation for more details.