Печать прямо на принтер в C ++ - PullRequest
0 голосов
/ 25 октября 2019

Есть ли способ напечатать счет, созданный в консольной программе c ++, прямо на принтер. Я просто хочу, чтобы я добавил некоторые вещи и их цены и распечатал их в чековом принтере. Это возможно? Я застрял, помогите мне.

      ofstream print;

      fs = new fstream ( SUPERMARKET_FILE_NAME, ios::in | ios::binary );
      print.open("SUPERMARKET.txt", ios::out);;
      cout << "Stream opened, sending text..." << endl;

                  print << "\n\n\n";
                  print << "Product ID\t\t\t: " << SUPERMARKET.productid << '\n'<<endl;
                  print << "Barcode Number\t\t\t: " << SUPERMARKET.barcodenum << '\n'<<endl;
                  print << "Name of Item\t\t\t: " << SUPERMARKET.nameofitem << '\n'<<endl;
                  print << "Amount of Item\t\t\t: " << SUPERMARKET.amountofitem << '\n'<<endl;
                  print << "Item Details\t\t\t: " << SUPERMARKET.itemdetails<< '\n'<<endl;
                  print << "Date\t\t\t\t: " << SUPERMARKET.date<< '\n'<<endl;
                  print << "Price\t\t\t\t: " << "RM "<<SUPERMARKET.price << '\n'<<endl;

      print.close();
...