如果傳入值是大寫字母,傳回小寫字母,否則傳回參數值。

 

#include <iostream>

#include <string>

using namespace std;

//-----------------------

int main()

{

  int i ;

  char str[10] = "HELLO" ;

  for(i = 0 ; i < strlen(str) ; i++ )

        str[i] = tolower(str[i]) ;

 

  cout << str << endl ;

  system("pause");

  return 0;

}

執行結果


 


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 pixnote21 的頭像
    pixnote21

    pixnote21的隨手筆記

    pixnote21 發表在 痞客邦 留言(0) 人氣()