HelloWorld 善戰者,求之于勢,不責于人;故能擇人而任勢。

          知止而后有定,定而后能靜,靜而后能安,安而后能慮,慮而后能得。物有本末,事有終始。知所先后,則近道矣。

            BlogJava :: 首頁 ::  :: 聯系 ::  :: 管理 ::
            167 隨筆 :: 1 文章 :: 40 評論 :: 0 Trackbacks

          #include <iostream.h>
          #include <cstdlib>
          #include <fstream> 
          #include <stdio.h>
          using namespace std;

          int main(int argc, char *argv[])
          {
              char* str = "e:/test/nihao.txt";
              FILE *t = fopen(str,"wb+");
              char tbuf[10]={0};
              fwrite(tbuf,1,100,t);
              fclose(t);
              system("PAUSE");
              return EXIT_SUCCESS;
          }



          FILE *tIn = fopen(szStr,"rb");
              if (tIn == NULL) {
                 cout<<"文件不能打開!";
                 return NULL;
              }
              fseek(tIn, 0, SEEK_END);
              int tSize = ftell(tIn);
              fseek(tIn, 0, SEEK_SET);
              char *tBuf = new  char[tSize];
              fread(tBuf,tSize,1,tIn);
              fclose(tIn);

          </script>

          posted on 2007-11-02 16:15 helloworld2008 閱讀(1473) 評論(0)  編輯  收藏 所屬分類: Linux/C
          主站蜘蛛池模板: 乃东县| 白水县| 夏邑县| 揭阳市| 盐城市| 潞西市| 光泽县| 宾阳县| 资中县| 玉门市| 阜康市| 桂平市| 河池市| 都昌县| 黄大仙区| 民乐县| 白银市| 天峨县| 南昌市| 灵武市| 宜兴市| 德令哈市| 进贤县| 富民县| 高邑县| 安徽省| 平乐县| 商南县| 旅游| 扎鲁特旗| 平安县| 喀喇沁旗| 灵丘县| 安溪县| 宜阳县| 长寿区| 临沭县| 嘉祥县| 迁西县| 克什克腾旗| 溧水县|