Jump to content

what is "argc" and "argv[]" in systemc?

Recommended Posts

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;


Share this post

Link to post
Share on other sites

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.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now