close

//---------------------------------------------------------------------------
/*********************************************************
範例4-5                                                  *
*********************************************************/
#include <iostream>

//---------------------------------------------------------------------------
char char1;    //第一個字元
char char2;    //第二個字元
char char3;    //第三個字元

int main(int argc, char* argv[])
{
        char1 = 'A';
        char2 = 'B';
        char3 = 'C';
        std::cout << char1 << char2 << char3 << " reversed is "
                  << char3 << char2 << char1 << "\n";
        std::system("pause");
        return 0;
}
//---------------------------------------------------------------------------


執行後會印出:
    ABC reversed is CBA




資料來源:C++風格與藝術 第二版 Steve Oualline 著 黃吉霈 編譯


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

    Quality of life is not what you get but what you become

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