Code:
char Random_Char;
char Altered_Filename[16];
Avoid global variables - use arguments.
Code:
if(Random_Char <= 25)
{
Random_Char += 97;
}
else if(Random_Char >= 26 && Random_Char <= 51)
{
Random_Char += 39;
}
else if(Random_Char >= 52)
{
Random_Char -= 4;
}
Confusing. Try using chars instead - if Random_Char <= 'a') for example.
Code:
do{
Get_Random_Char();
Altered_Filename[Chars_In_Name] = Random_Char;
Chars_In_Name++;
}while (Chars_In_Name != 13);
Indent properly.
Code:
Altered_Filename[13] = '.';
Altered_Filename[14] = 'd';
Altered_Filename[15] = 'l';
Altered_Filename[16] = '\0';
Preferably, use std::string or strcat.
Code:
if (rename(argv[1], Altered_Filename) != 0)
As you can see, the argument is the full path to the file, but your renamed filename isn't. The behavior is actually defined, but you're overlooking it.
See rename for more information. Specify full path or switch current directory to the directory where your file to be renamed is.
Try not to mix spaces and tabs. Use only tabs or only spaces for indentation. I recommend tabs.