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 阅读(1456) 评论(0)  编辑  收藏 所属分类: Linux/C

只有注册用户登录后才能发表评论。


网站导航: