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 閱讀(1479) 評論(0)  編輯  收藏 所屬分類: Linux/C
          主站蜘蛛池模板: 巩义市| 昌都县| 石棉县| 盖州市| 南郑县| 通榆县| 会东县| 武安市| 湘阴县| 清丰县| 金川县| 石泉县| 丰镇市| 辉南县| 二连浩特市| 清新县| 晴隆县| 龙口市| 鱼台县| 邢台市| 太仆寺旗| 铁岭县| 云阳县| 宁海县| 六枝特区| 玉山县| 盐池县| 龙泉市| 专栏| 贵阳市| 大兴区| 漳平市| 郁南县| 九寨沟县| 神池县| 广汉市| 兴文县| 陇西县| 平山县| 旅游| 吉木萨尔县|