I would like to be able to set a flag for a program im running ...my program backs up my files when i run it example (sudo bu.exe) will run it.But i want to set a flag instead of making a completly diferent program for removing the backups.I want to be able to type (sudo bu -a) to remove the backups when im done working in that directory
Look up command line arguments. Whatever arguments you pass to the program will be saved in two variables passed to main - an int and an array of C style strings. In a simple application you have to parse the strings yourself to see if any of them are valid flags, but it normally isn't very hard.
a command line function has 2 arguments, an int and a char. Int being the number of flags that are supplied, and the char* array being the flags that were set. Setting your main() function to work with this is simple:
int main( int argc, char* argv )
// Do your code