How to "cout" this?

Hi guys , I am making an application just for fun 0_0 , and I have a little problem with it. The idea is to be able to run a "system" commands before the user imput the number . this is what I have :

#include <iostream>
#include <cstdlib>
int main()
using namespace std;
int var1;
int var2=3600;
int var3;

cout<<"Enter the time"<<endl;
system("shutdown -s -t "time_here(var3)" ")


Last edited on
It's a bit complex, but I'd use stringstream to construct the string from the constants and the number the user entered.
std::stringstream ss;
ss<<"shutdown -s -t "<<var3;
system(ss.str().c_str()); //...or something 
Thanks for your reply but does not worked for me , maybe I am doing it wrong
Please post all of your code using [code] tags and the errors.
Last edited on
Topic archived. No new replies allowed.