int shutdown()
    int time;
    int hmm;
  	string name2file;
   	string name;
   	string nametofile;
   	string name2;
   	ofstream file;
   	ofstream file2;
    cout << "\nHow long do you want to wait till shutdown?(in seconds)\n";
    cin >> time;
    cout << "What would you like to name the batch file?\n";
    name2file = name + ".bat";
    const char *x = name2file.c_str(); (x);
    cout << "\n";
    cout << "What text do you want when closeing?\n";
    cin >> name2;
    nametofile = name2;
    const char *y = nametofile.c_str();
    file << "start shutdown.exe -s -t " << time << " -c " << y;
    cout << "Shutdown batch was made.\nwould you like to make a batch to abort shutdown?\nAbore batch is the same as restarts abort.\nEnter 1 if yes.\n";
    cin >> hmm;
    if(hmm == 1)
  ("Abort .bat");
           file2 << "shutdown -a";
  return 0;

This is just a function from my program but when i run it and after i enter the time it just skips asking the name and just ask for the message. Anyone no how to fix it?