Command line execution

+2 Samiha S. · February 1, 2015
How would you make your program do something differently based on different commands?

For example, lets say I have a text file with some text were I want to replace some characters "X" with "O"

The following command line should be able to execute this when written on the terminal -

./image_processing.out output4_erosion.txt output4_opening.txt replace X O

Also, I might decide to do something else with the text file and do something like this -
./image_processing.out output4_erosion.txt output4_opening.txt dilation X

How would I make sure these different command lines work on my program? I have never used a terminal before and have no clue how it works

Post a Reply


Oldest  Newest  Rating
0 Mahmoud Abdel Ghani · February 1, 2015
what you want to do??your question isnt understand?
0 Samiha S. · February 1, 2015
how to make my program do different things based on different commands (replace X 0, dilation X)?
0 Mahmoud Abdel Ghani · February 1, 2015
can u show me the code?
0 Samiha S. · February 2, 2015
@Krootushas Gesu 

Thank you so much! You really explained it in detail, it is very clear now!
  • 1



Used in many types of software including music players, video games, and many large scale applications.

Bucky Roberts Administrator