SystemC Hello World

 Hello World 


#include "systemc.h"

int sc_main (int argc, char* argv[]) {
  
  cout <<"Hello World "<< endl;
  return 0;// Terminate simulation
  
}

Simulator Output :

Hello World
Execute the above code on 


#include "systemc.h":
Includes SystemC library header file.

int sc_main (int argc, char* argv[ ]):
int is the return value.

sc_main() is entry point to the users code form library, It is called by the function main() which is part of the SystemC library.

The arguments argc and argv[] are the standard command-line arguments. They are passed to sc_main() from main() in the library.

{ } :
The two curly brackets are used to indicate the beginning and the end of the function sc_main.

cout:
cout represents the standard output stream in C++.

return 0;
The return statement causes the main function to finish.

 Basic Input and Output 


Cin, cout, cerr and clog are are the instance of ostream class,

Cin   – gets the input from standard input device.
Cout – To display message on standard output device.
Cerr  – To display error message on standard output device.
Clog – To display log message on standard output device.