I have a project for my Data Structures class, which is a file compressor that works using Binary Trees and other stuff. We are required to “zip” and “unzip” any given file by using the following instructions in the command line:
For compressing: compressor.exe -zip file.whatever
For uncompressing: compressor.exe -unzip file.zip
We are programming in C++. I use the IDE Code::Blocks and compile using GCC in Windows.
My question is: How do you even implement that??!! How can you make your .exe receive those parameters in command line, and then execute them the way you want?
Also, anything special to have in mind if I want that implementation to compile in Linux?
Thanks for your help
Lo logré, I gotz it!!
I now have a basic understanding on how to use the argc and argv[ ] parameters on the main() function (I always wondered what they were good for…). For example, if I put in the command line:
compressor.exe -unzip file.zip
Then:
Greg (not ‘Creg’, sorry =P) and Bemrose, thank you guys for your help!! ^^