• <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++ 基礎} {C++ 高級} {C#界面,C++核心算法} {設計模式} {C#基礎}

            有用但不常見的c++函數

             

            #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的文件狀態信息
               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];

                
            //設置新目錄
                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 夢在天涯 閱讀(1931) 評論(2)  編輯 收藏 引用 所屬分類: CPlusPlus

            評論

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

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

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

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

            公告

            EMail:itech001#126.com

            導航

            統計

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

            常用鏈接

            隨筆分類

            隨筆檔案

            收藏夾

            Blogs

            c#(csharp)

            C++(cpp)

            Enlish

            Forums(bbs)

            My self

            Often go

            Useful Webs

            Xml/Uml/html

            搜索

            •  

            積分與排名

            • 積分 - 1808585
            • 排名 - 5

            最新評論

            閱讀排行榜

            色综合合久久天天综合绕视看| 国产精品久久久久久久app| 日产精品久久久久久久性色| 少妇人妻综合久久中文字幕| 色偷偷偷久久伊人大杳蕉| 久久影视综合亚洲| 精品久久久久久国产91| 久久偷看各类wc女厕嘘嘘| 亚洲v国产v天堂a无码久久| 久久免费小视频| 国产精品成人99久久久久| 狠狠88综合久久久久综合网| 久久久精品国产Sm最大网站| 伊人久久久AV老熟妇色| 亚洲日韩欧美一区久久久久我| 久久久久国产一区二区三区| 97久久精品无码一区二区天美| 一本一道久久精品综合| 粉嫩小泬无遮挡久久久久久| 久久综合精品国产一区二区三区| 久久精品人成免费| 日韩乱码人妻无码中文字幕久久| 亚洲国产精品久久久久婷婷软件 | 2021国产精品久久精品| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 久久久国产精品网站| 国产欧美久久一区二区| 久久99国产精品久久| 久久久久亚洲国产| 久久这里只有精品首页| 亚洲欧洲久久久精品| 久久婷婷综合中文字幕| 精品久久久中文字幕人妻| 99久久亚洲综合精品网站| 久久免费视频1| 蜜臀久久99精品久久久久久| 久久夜色精品国产噜噜亚洲AV| 97热久久免费频精品99| 亚洲欧美日韩精品久久亚洲区| 亚洲国产精品无码久久| 久久久久综合国产欧美一区二区|