Advertisement
Guest User

Untitled

a guest
Mar 5th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <conio.h>
  5. using namespace std;
  6.  
  7. int main() {
  8.     string barcode;
  9.     string key;
  10.     int cha;
  11.     int count = 1;
  12.     char c;
  13.     cout << "Scan... mit LEER Beenden" << '\n';
  14.     do
  15.     {
  16.         c = getch();
  17.         if (c=='#')
  18.         {
  19.             do
  20.             {
  21.                 c=getch();
  22.                 if (c!='*')
  23.                 {
  24.                     key=c;
  25.                     barcode.append(key);
  26.                 }
  27.             }
  28.                 while (c!='*');
  29.                 ofstream myOutPutFile("scan.ini", ofstream::app);
  30.                 cout << count << '=' << barcode << '\n';
  31.                 myOutPutFile << count << '=' << barcode << '\n';
  32.                 count++;
  33.             myOutPutFile.close();
  34.             barcode="";
  35.         }
  36.         cha=c;
  37.     }
  38.     while (cha!=32);
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement