How to rename file in C

1 Answer

0 votes
#include <stdio.h>
   
int main(int argc, char **argv) 
{ 
    if ( rename("d:\\data.bin", "d:\\data_new_name.bin") )
        perror(NULL);
    else
        printf("rename success");
    
    return 0;
}
   
/*
  
run:
   
rename success

*/

 



answered Aug 25, 2015 by avibootz
edited Aug 26, 2015 by avibootz

Related questions

1 answer 355 views
355 views asked Jul 12, 2020 by avibootz
1 answer 296 views
296 views asked Jun 9, 2018 by avibootz
1 answer 270 views
270 views asked Aug 22, 2023 by avibootz
1 answer 325 views
325 views asked Mar 10, 2020 by avibootz
1 answer 350 views
1 answer 335 views
335 views asked Aug 26, 2015 by avibootz
2 answers 421 views
421 views asked Aug 26, 2015 by avibootz
...