I have 2 questions: 1 - how to count the whole line? 2 - how to count only the third line? The first variable of type int remaining std::string . From the screenshot it can be seen that the reading takes place according to the words and the separator of the variables is a space.
Program Code:
#include <windows.h> // кириллица #include <iostream.h> // ввод-вывод #include <cstdlib> // конвертация #include <string> // строка #include <fstream> // чтение-запись int unp_consignee; // унп грузополучателя std::string consignee; // грузополучатель std::string the_goods_to_delivery_have_accepted; // товар к доставке принял std::string by_proxy; // по доверенности std::string give_out; // выданной std::string the_consignee_has_accepted; // принял грузополучатель if (settings_txt_reading.is_open()) { settings_txt_reading >> unp_consignee; settings_txt_reading >> consignee; settings_txt_reading >> the_goods_to_delivery_have_accepted; settings_txt_reading >> by_proxy; settings_txt_reading >> give_out; settings_txt_reading >> the_consignee_has_accepted; } Text file data:
20 dfgdf dfgdfg dfgdfg dfg3 dfgdf344 44 sdfsd55 66 66 67 
std::getline ( settings_txt_reading, consignee);- vp_arth