Hi everyone I have a problem

// write_file.cpp: определяет точку входа для консольного приложения. #include "stdafx.h" #include <iostream> #include <fstream> // работа с файлами #include <iomanip> // манипуляторы ввода/вывода using namespace std; int main(int argc, char* argv[]) { setlocale(LC_ALL, "rus"); // связываем объект с файлом, при этом файл открываем в режиме записи, предварительно удаляя все данные из него ofstream fout("License.txt", ios_base::out | ios_base::trunc); if (!fout.is_open()) // если файл небыл открыт { cout << "Файл не может быть Записан\n"; // напечатать соответствующее сообщение return 1; // выполнить выход из программы } fout << "data type" << endl; fout.close(); // программа больше не использует файл, поэтому его нужно закрыть cout << "БЕБЕБЕБЕ\n"; system("pause >> void"); return 0; } 

At start 2 files are created and not one 1 License.txt file and the second void without the format But only License.txt should be created!

    3 answers 3

    Why write so? -

     system("pause >> void"); 

    Just call the command

     system("pause"); 
    • But wanted with system ("pause >> void"); put the system ("pause"); Thank! - RconPro 1:09 pm
    • And it's better not to do this at all. Call a new team - brrr. - alexlz

    You do make a call to the pause command at the end and redirect its output to a file with the name void. You can redirect output to / dev / null so that it doesn’t.

    • As I understand it, a person writes in Windows. - skegg
    • Let cygwin put, there / dev / null is. - alexlz
    • what a beauty - skegg
    • In Windows, the analogue of / dev / null is just nul - avp
    • NUL: - this is from the dos (and maybe earlier) - alexlz

    Apparently this is the line system ("pause >> void"); and creates a second