• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            馬賽克007歡迎你

            htt://shexinwei.blogbus.com

            http://m.shnenglu.com/shexinwei

            感謝大家的支持

            the difference of some Input function

            1 /* 2 Subject: the difference of gets(),getch(),getchar() and getline() 3 Author: shexinwei 4 School: xidian university 5 Date: 2010-09-09 6 Laguage: C++ 7 IDE: visual studio 6.o 8 Version: 1.0 9 Modify Time: 2010-09-09 10 */ 11 #include <iostream> 12 using namespace std; 13 #include <conio.h> 14 #define MAX_LEN 20 15 int main() 16 { 17 18 //gets() : Get a line from the stdin stream. 19 //Get a line from the stdin stream. 20 21 cout<<"the function gets():"<<endl; 22 char buffer[MAX_LEN]; 23 gets(buffer); 24 cout<<buffer<<endl; 25 26 // getchar(): 27 // marco: #define getchar() getc(stdin) File: STDIO.H Get a character from a file; 28 // function: _CRTIMP int __cdecl getchar(void); File: STDIO.H Get a character from stdin; 29 char tmp = 0; 30 cout<<endl<<endl<<"the function getchar():"<<endl; 31 cout<< (char)getchar(tmp) <<endl; 32 33 //getline(): 34 //basic_istream<Elem, Tr>& getline(char_type *_Str, streamsize _Count); 35 //Gets a line from the input stream. 36 cout<<endl<<endl<<"the function getline():"<<endl; 37 cin.getline(buffer,MAX_LEN); 38 cout<<buffer<<endl; 39 40 //getch(): 41 //This POSIX function is deprecated beginning in Visual C++ 2005. Use the ISO C++ conformant _getch instead 42 //Gets a character from the console without echo. 43 //int _getch( void ); 44 //Returns the character read. There is no error return. 45 //Headers: <conio.h> 46 cout<<endl<<endl<<"the function getch():"<<endl; 47 tmp = getch(); //without echo 48 // cout<<tmp<<endl; //print the character 49 50 51 system("pause"); 52 return 0; 53 54 }

            posted on 2010-09-10 08:44 馬賽克007 閱讀(1497) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            <2010年9月>
            2930311234
            567891011
            12131415161718
            19202122232425
            262728293012
            3456789

            導(dǎo)航

            統(tǒng)計

            公告

            QQ:306334649 本博客所發(fā)代碼皆為作者原創(chuàng),大家可以隨便使用。

            常用鏈接

            留言簿(1)

            隨筆檔案

            文章分類

            我的博客

            搜索

            最新評論

            閱讀排行榜

            評論排行榜

            大香伊人久久精品一区二区| 熟妇人妻久久中文字幕| 777久久精品一区二区三区无码| 国产精品99久久免费观看| 91精品日韩人妻无码久久不卡| 久久久久人妻一区精品果冻| 久久久久亚洲AV无码观看| 国内精品久久久久伊人av| 婷婷久久精品国产| 国产精品久久久福利| 亚洲七七久久精品中文国产| 精品国产乱码久久久久久郑州公司 | 亚洲国产成人精品91久久久 | 久久国产色AV免费观看| 久久免费99精品国产自在现线| 伊人久久综合精品无码AV专区| 99久久国产综合精品五月天喷水 | 亚洲综合久久久| 国产精品青草久久久久福利99 | 久久久精品波多野结衣| 97超级碰碰碰久久久久| 中文字幕人妻色偷偷久久| 色欲综合久久躁天天躁| 成人精品一区二区久久久| 国产一级持黄大片99久久| 久久精品毛片免费观看| 久久免费的精品国产V∧| 久久精品aⅴ无码中文字字幕不卡| 精品国产乱码久久久久久浪潮| 99麻豆久久久国产精品免费| 午夜人妻久久久久久久久| 青青草原精品99久久精品66| 国产成年无码久久久免费| 亚洲国产婷婷香蕉久久久久久| 久久免费视频6| 久久99国产精品成人欧美| 欧美久久精品一级c片片| 成人妇女免费播放久久久| 亚洲精品乱码久久久久久蜜桃图片| 久久久久99精品成人片三人毛片| 国产精品18久久久久久vr|