home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / brklyprl.lha / Emulator / Instructions / upcase.c < prev   
Encoding:
C/C++ Source or Header  |  1989-04-14  |  324 b   |  21 lines

  1.  
  2. /* Copyright (C) 1988, 1989 Herve' Touati, Aquarius Project, UC Berkeley */
  3.  
  4. #include <stream.h>
  5. #include <ctype.h>
  6.  
  7. extern int strlen(char*);
  8. main()
  9. {
  10.   char buf[80];
  11.   char* p;
  12.   char* p0;
  13.  
  14.   cin >> buf;
  15.   p = buf;
  16.   p0 = p + strlen(buf);
  17.   for (; p < p0; p++)
  18.     *p = (islower(*p)) ? toupper(*p) : *p;
  19.   cout << buf;
  20. }
  21.