I'm having a tough time trying to figure out what the heck is wrong with my code.
If anyone would like to help, that'd be cool.
here's my code.
void renamefile( void );
for( input = 0; input <= 2; input++)
printf(">>>> 1. Rename file\n");
printf(">>>> 2. Exit Program\n");
printf("\nEnter selection: ");
if( input == 1 )
printf("Entering Rename file. . .\n");
if( input == 2 )
void renamefile( void )
char oldname, newname;
printf("Enter current filename: ", oldname);
printf("Enter new filename: ", newname);
if( rename( oldname, newname ) == 0)
printf("File %s has been rename to %s.\n", oldname, newname);
fprintf(stderr, "Somethings screwed.\n");
When it compiles, it's all good and dandy then when I execute it it outputs this
>>>> 1. Rename file
>>>> 2. Exit program
Enter Selection: 1
Entering Rename file. . .
Enter current filename: Enter new filename:
As you can see, it's not exactly doing what i want it to...