请问在TC中有没有类似VC中的CopyFile函数啊?

解决方案 »

  1.   

    c++的标准库,绝对不同于C;
    但是作为C的超集,有部分函数是有的。你可以用MSDN查查,一看便知!~
      

  2.   

    i write a function such as copyfile in TC and BC3.1
    //
    //Copy ResFile to DestFile
    FILE *out;
    FILE *in;
    char* buf = new char[1024];
    memset(buf, NULL, sizeof(buf));
    if((in = fopen(szElderPath, "rb"))== NULL)
    {
    printf("Cannot open input file.\n");
    return 0;
    }
    if ((out = fopen(szOldPath, "wb"))== NULL)
    {
    printf("Cannot open output file.\n");
    return 0;
    }
    int nlen=0;
    do
    {
    nlen=fread(buf,1024,1,in);
    fwrite(buf,1024,1,out);
    }
    while(nlen>0);
    fclose(out);
    fclose(in);