SHARE
TWEET

Untitled

a guest Jan 28th, 2011 213 Never
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <string>
  4. #include <iostream>
  5. #include <fstream>
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10.     FILE * pFile;
  11.         string a;
  12.         cout << "Program is predefined... \n";
  13.         cout << "Input: ";
  14.         cin >> a;
  15.         pFile = fopen ("Personal Shop Codes.txt","a+");                
  16.         for( int i = 0; i < a.size(); i++ )
  17.          {  
  18.           fprintf(pFile, "%hX ", a[i]);
  19.          }
  20.         cout << endl;  
  21.     fclose (pFile);      
  22.     cout << "Done! Check your file \n";
  23.         return 0;
  24. }
RAW Paste Data
Top