home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_08 / hellquis / testwri.cpp < prev    next >
C/C++ Source or Header  |  1993-01-24  |  740b  |  33 lines

  1. //testwri.cpp  -- simple test routine for WritePrivateProfileString
  2. #include "profiles.h"
  3. #include <string.h>
  4. #include <iostream.h>
  5.  
  6.  
  7. void main()
  8. {
  9.     char app[81];
  10.     char key[81];
  11.     char string[81];
  12.     int no ;
  13. //-- part one , test getting all keys for an application
  14.     cout << "This test uses file test.ini\n";
  15. //-- part two, repeatedly test getting a specific key
  16.     for (;;)
  17.     {
  18.         cout << "Application :";
  19.         cin.get(app,sizeof(app));
  20.         cin.ignore();
  21.         cout << "Key :";
  22.         cin.get(key,sizeof(key)) ;
  23.         cin.ignore();
  24.         cout << "String :";
  25.         cin.get(string,sizeof(string)) ;
  26.         cin.ignore();
  27.         no = WritePrivateProfileString
  28.         (app,key,string,"test.ini");
  29.         cout << "no : " << no << "\n" ;
  30.     }
  31. }
  32.  
  33. //-- end of testwri.cpp