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
          主站蜘蛛池模板: 闽清县| 正安县| 嘉兴市| 西平县| 喀喇| 横峰县| 雅安市| 谷城县| 桦川县| 彰化市| 纳雍县| 余江县| 高安市| 南郑县| 漠河县| 江口县| 乐平市| 阜新| 无为县| 施甸县| 台东县| 永康市| 大荔县| 沈阳市| 登封市| 神农架林区| 双辽市| 汝州市| 晋宁县| 墨脱县| 富民县| 昭觉县| 同德县| 会东县| 永顺县| 中牟县| 多伦县| 开江县| 南丰县| 类乌齐县| 环江|