How to rename a file in Microsoft Visual C++ 6.0

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 1
Reputation: Tim UK is an unknown quantity at this point 
Solved Threads: 0
Tim UK Tim UK is offline Offline
Newbie Poster

How to rename a file in Microsoft Visual C++ 6.0

 
0
  #1
Jun 15th, 2008
Ok i want to rename a file example:
C://test.txt to C://new.txt
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 50
Reputation: guy40az is an unknown quantity at this point 
Solved Threads: 2
guy40az guy40az is offline Offline
Junior Poster in Training

Re: How to rename a file in Microsoft Visual C++ 6.0

 
0
  #2
Jun 15th, 2008
int rename( const char *oldname, const char *newname );
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 50
Reputation: guy40az is an unknown quantity at this point 
Solved Threads: 2
guy40az guy40az is offline Offline
Junior Poster in Training

Re: How to rename a file in Microsoft Visual C++ 6.0

 
0
  #3
Jun 15th, 2008
Here is an Example

/* rename example */
#include <stdio.h>

int main ()
{
int result;
char oldname[] ="oldname.txt";
char newname[] ="newname.txt";
result= rename( oldname , newname );
if ( result == 0 )
puts ( "File successfully renamed" );
else
perror( "Error renaming file" );
return 0;
}
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC