Hi,
here is my code
Qt Code:
  1. string cmdCommand(const string &command){
  2. fstream file("temp.txt");
  3. file.close();
  4. string cmd=command+ "> temp.txt";
  5. file.open("temp.txt");
  6. stringstream buffer;
  7. buffer << file.rdbuf();
  8. file.close();
  9. return buffer.str();
  10.  
  11. try{
  12. result= cmdCommand("ping google.com");
  13. }
  14. catch(const char* exc)
  15. {
  16. cout<<exc;
  17. }
  18.  
  19. }
  20.  
  21. void MainWindow::on_pushButton_clicked()
  22. {
  23. cmdCommand();
  24. ui->textBrowser->setText(QString::fromStdString(result));
  25. }
To copy to clipboard, switch view to plain text mode 

when i compile this code this error shows:
error: too few arguments to function 'std::string cmdCommand(const string&)'
cmdCommand();
^
thanks