• <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>

            C++ Programmer's Cookbook

            {C++ 基礎(chǔ)} {C++ 高級} {C#界面,C++核心算法} {設(shè)計模式} {C#基礎(chǔ)}

            有用但不常見的c++函數(shù)

             

            #include<iostream.h>
            #include 
            <time.h>
            #include 
            <sys/types.h>
            #include 
            <sys/stat.h>
            #include 
            <stdio.h>

            void main( void )
            {
                
            struct stat buf;
                
            int result;

                
            //獲得c:\Windows\Calc.exe文件的信息
                result =stat( "c:\\windows\\Calc.exe"&buf );

                
            //顯示cal.exe的文件狀態(tài)信息
               if( result != 0 )
                   perror( 
            "Problem getting information" );
                
            else
                
            {
                    cout
            <<"Size of the file in bytes:"<<buf.st_size<<endl;
                    cout
            <<"Drive number of the disk containing the file :";
                    cout
            <<char(buf.st_dev + 'A')<<endl;
                    cout
            <<"Time of creation of the file:"<<ctime(&buf.st_ctime);
                    cout
            <<"Time of last access of the file:"<<ctime(&buf.st_atime);
                    cout
            <<"Time of last modification of the file:"<<ctime(&buf.st_mtime);
               }

            }
            #include<iostream.h>
            #include
            <direct.h>
            #include
            <errno.h>
            #define MAX_PATH 250
            main()
            {
                
            //聲明變量
                char *p,str[MAX_PATH];

                
            //設(shè)置新目錄
                if (mkdir("d:\\ABC")){
                    cout
            <<"mkdir Error!"<<endl;
                }


                
            //更改工作目錄
                if (chdir("d:\\ABC")){
                    cout
            <<"chdir Error!"<<endl;
                }


                
            //讀取當前的目錄
                if ((p=getcwd(str,MAX_PATH))==NULL) {
                    cout
            <<"getcwd Error!"<<endl;
                }

                
            else
                
            {
                    cout
            <<"p:"<<p<<endl;
                    cout
            <<"str:"<<str<<endl;
                }


                
            //?ü??1¤×÷????
                if (chdir("d:\\")){
                    cout
            <<"chdir Error!"<<endl;
                }


                
            //刪除指定目錄
                if (rmdir("d:\\ABC")==-1
                    cout
            <<"rmdir Error!"<<endl;
            }


            #include
            <iostream.h>
            #include 
            <string.h>

            char string[80];
            char seps[]   = " ,\t\n";
            char *token;

            void main( void )
            {
                
            //′ó?ü?ìé?ê?è?á???ó???
                for (int i=1;i<3;i++{
                    cout
            <<"Please input a sentence:"<<endl;
                    
            //??DDê?è?
                    cin.getline(string,80);             
                    cout
            <<"Tokens:"<<endl;
                    
            //首次分離字符串
                    token = strtok( string, seps );        
                    
            while( token != NULL )              //?áê?·?à??D??
                    {
                        cout
            <<token<<endl;
                        
            //下次分離字符串         
                              token = strtok( NULL, seps );   

                    }

                }

            }

            posted on 2005-11-04 14:55 夢在天涯 閱讀(1925) 評論(2)  編輯 收藏 引用 所屬分類: CPlusPlus

            評論

            # re: 有用但不常見的c++函數(shù) 2005-11-05 22:58 peter

            是要unix平臺支持的吧!  回復  更多評論   

            # re: 有用但不常見的c++函數(shù) 2005-11-07 08:49 夢在天涯

            不需要的啊,你可以在你的windows上可以運行的啊 !  回復  更多評論   

            公告

            EMail:itech001#126.com

            導航

            統(tǒng)計

            • 隨筆 - 461
            • 文章 - 4
            • 評論 - 746
            • 引用 - 0

            常用鏈接

            隨筆分類

            隨筆檔案

            收藏夾

            Blogs

            c#(csharp)

            C++(cpp)

            Enlish

            Forums(bbs)

            My self

            Often go

            Useful Webs

            Xml/Uml/html

            搜索

            •  

            積分與排名

            • 積分 - 1804663
            • 排名 - 5

            最新評論

            閱讀排行榜

            亚洲?V乱码久久精品蜜桃| 国内精品久久久久国产盗摄| 亚洲AV无码一区东京热久久| 无码专区久久综合久中文字幕| 精品久久久无码人妻中文字幕| 久久久婷婷五月亚洲97号色| 韩国无遮挡三级久久| 国内精品久久久久久麻豆| 久久亚洲精品国产亚洲老地址 | 久久久国产打桩机| 久久久久久久久无码精品亚洲日韩| 精品久久一区二区| 人妻少妇精品久久| 精品久久久久久国产潘金莲| 久久精品三级视频| 亚洲欧美伊人久久综合一区二区| 国产情侣久久久久aⅴ免费| 久久久久久极精品久久久| 三上悠亚久久精品| 久久久久久无码国产精品中文字幕| 久久国产欧美日韩精品| 精品久久久久国产免费| 久久夜色精品国产噜噜噜亚洲AV| 色综合久久88色综合天天 | 18岁日韩内射颜射午夜久久成人| 亚洲欧洲中文日韩久久AV乱码| 久久久久人妻一区精品性色av| 久久WWW免费人成—看片| 久久精品一本到99热免费| 性做久久久久久久久| 伊人久久大香线焦综合四虎| 日韩AV无码久久一区二区| 久久亚洲国产精品五月天婷| 久久99精品国产99久久6男男| 综合人妻久久一区二区精品| 国产精品成人99久久久久 | 日韩久久无码免费毛片软件| 久久se精品一区精品二区| 性高湖久久久久久久久| 欧美成a人片免费看久久| 精品久久久久久无码国产|