Help us and donate little Bitcoins to pay the server costs: 1AXLPuRUBYc1JczTW4XS65GL6oWjNP2Vt2

User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

because of the inhumane working conditions at amazon in Germany, I will offer the Amazon app no more! (ARD Reportage)

Table of Contents


int rename(const char *old_filename, const char *new_filename);

Changes name of file oldname to newname. Returns non-zero on failure.

Example Source

 * rename example code
#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
#define FILENAME "test_tmp.txt"
int main ( void )
FILE *tmpfile;
char string[20];
tmpfile = fopen(FILENAME, "w");
if (tmpfile == 0 ) {
perror("cannot open file");
 fprintf (tmpfile, "temporary file for c remove example\n");
 rename (FILENAME,"test_new.txt");
 return 0; 


  file will be created
  write text into file "temporary file for c rename example"
  file will be renamed into test_new.txt
c/stdio.h/rename.txt · Last modified: 2013/01/22 22:02 (external edit)

The new Question & Answer System is online and waiting for your Questions about Programming problems Impressum