简体   繁体   中英

Windows Command Prompt Input Explaination

Could you help me understand this input into the command line :

type direct-mapped.input | mem_sim 8 2 2 1 2 1 2 2

direct-mapped.input is a file with info that is read in a cpp file. mem_sim is the cpp file that has been compiled and the numbers following mem_sim are inputs into the cpp file.

Also how are these values stored in the cpp file?

Thanks in advance

In *nix and Windows operating systems, the numbers are not stored in the CPP file; nothing will modify the source file.

The operating system stores the numbers in an argument list that is passed to the main function in your program (aka the 2nd parameter to main ).

ArgC  |  ArgV
--------------
0     |  mem_sim
1     |  8
2     |  2
3     |  2
4     |  1
5     |  2
6     |  2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM