Jump to content
TRANG

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...