Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ rename function

#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
	char oldname[] = "file_old.txt";
	char newname[] = "file_new.txt";
	
	/*	Deletes the file if exists */
	if (rename(oldname, newname) != 0)
		perror("Error renaming file");
	else
		cout << "File renamed successfully";
	
	return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to find product of a given numbers in c++ 
Cpp :: std::map get all keys 
Cpp :: integer max value c++ 
Cpp :: backtrack 
Cpp :: pow without math.h 
Cpp :: c++ - 
Cpp :: Split a number and store it in vector 
Cpp :: c++ if else example 
Cpp :: DSA 2. Complexity Analysis Google drive Educative excellent courses!!!! [Educative.io] Competitive Programming in C++ The Keys to Success 
Cpp :: string copy in cpp 
Cpp :: why return 0 in int main 
Cpp :: c++ create function pointer 
Cpp :: C++ function inside main 
Cpp :: build a prefix array cpp 
Cpp :: cpp language explained 
Cpp :: C++ Class Template Declaration 
Cpp :: c++ allocate dynamic with initial values 
Cpp :: how to compile c++ code with g+ 
Cpp :: gcd of two numbers 
Cpp :: string class in c++ 
Cpp :: the amount of input is unknown 
Cpp :: C++ Initializing a thread with a class/object 
Cpp :: Corong_ExerciseNo3 
Cpp :: glUniform bool 
Cpp :: find min and max in array c++ 
Cpp :: beecrowd problem 1001 solution in c++ 
Cpp :: ordine crescente di numeri indefiniti in c++ 
Cpp :: hackerearth questions siemens 
Cpp :: CPP Find options passed from command line 
Cpp :: code::block uncomment 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =