DS1701 Posted May 15, 2018 Report Posted May 15, 2018 I don't know what is "argc" and "argv []" , Can you explain about this?And when does it change ? #include "systemc.h" int sc_main (int argc, char* argv[]) { cout<<"Value of argc="<<argc<<endl; cout <<"Value of argc[]="<<hex<<argc<<endl; return 0; } Quote
Eyck Posted May 15, 2018 Report Posted May 15, 2018 Hi, These are the command line arguments argc and argv which are propagated from main(). See also https://stackoverflow.com/questions/3024197/what-does-int-argc-char-argv-mean#3024202 Best Quote
David Black Posted May 15, 2018 Report Posted May 15, 2018 Doesn't make as much sense to those who use Windows and Visual Studio. Much more understandable if you use Linux. Tip: You can access those two arguments from anywhere in your SystemC design using the two functions: sc_argc() and sc_argv(), which are in the sc_core namespace. Keep in mind that they only provide access to c_str values. If you want to interpret a numeric value from the command-line, you will need to convert it yourself. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.