stage4/stage4.cc
changeset 26 fd67f54e64e1
parent 0 fb772792efd1
child 27 667721cf52c5
equal deleted inserted replaced
25:e6a841e365b7 26:fd67f54e64e1
    77   for (int i = 0; str[i] != '\0'; i++)
    77   for (int i = 0; str[i] != '\0'; i++)
    78     std::cout << (unsigned char)toupper(str[i]);
    78     std::cout << (unsigned char)toupper(str[i]);
    79   return NULL;
    79   return NULL;
    80 }
    80 }
    81 
    81 
       
    82 void *stage4out_c::printlocation(const char *str) {
       
    83   std::cout << "__";
       
    84   for (int i = 0; str[i] != '\0'; i++)
       
    85     if(str[i] == '.')
       
    86       std::cout << '_';
       
    87     else
       
    88       std::cout << (unsigned char)toupper(str[i]);
       
    89   return NULL;
       
    90 }
    82 
    91 
    83 void *stage4out_c::print(std::string str) {
    92 void *stage4out_c::print(std::string str) {
    84   std::cout << str;
    93   std::cout << str;
    85   return NULL;
    94   return NULL;
    86 }
    95 }
    98   /* Or more simply... */
   107   /* Or more simply... */
    99     printupper(str.c_str());
   108     printupper(str.c_str());
   100 #endif
   109 #endif
   101   return NULL;
   110   return NULL;
   102 }
   111 }
   103 
   112 void *stage4out_c::printlocation(std::string str) {
       
   113   printlocation(str.c_str());
       
   114 }
   104 
   115 
   105 
   116 
   106 /***********************************************************************/
   117 /***********************************************************************/
   107 /***********************************************************************/
   118 /***********************************************************************/
   108 /***********************************************************************/
   119 /***********************************************************************/