Создание пустого выходного файла [дубликат]C++

Программы на C++. Форум разработчиков
Anonymous
Создание пустого выходного файла [дубликат]

Сообщение Anonymous »

Я написал код для создания выходного файла в своей системе на C++. Функция выполняется, но единственная проблема заключается в том, что созданный выходной файл пуст. Может кто-нибудь сказать мне, что я делаю не так?
Входной файл выглядит следующим образом:

Код: Выделить всё

"1","02","Advance notification (confirmed)","Use for a complete record issued to confirm advance information approximately six months before publication; or for a complete record issued after that date and before information has been confirmed from the book-in-hand","0"
Код, который я написал:

Код: Выделить всё

#include 
#include 
#include 

int main() {
std::ifstream inputFile("/Users/a0p0ieu/Desktop/specRules/list.csv");
std::ofstream outputFile("/Users/a0p0ieu/Desktop/specRules/output_spec.txt");
std::string line;

while (getline(inputFile, line)) {
std::istringstream iss(line);
std::string col1, col2, col3;
getline(iss, col1, ',');
getline(iss, col2, ',');
getline(iss, col3, ',');

if (col1 == "1") {

outputFile 

Подробнее здесь: [url]https://stackoverflow.com/questions/78708894/generating-empty-output-file[/url]

Вернуться в «C++»