hello world
C
#include <stdio.h> int main(){ printf("hello world\n"); return 0; }
编译使用
gcc helloworld.c
C++
#include <iostream> int main(){ std::cout << "hello world" << std::endl; return 0; }
编译使用
g++ helloworld.cpp
SystemC
#include <systemc> using namespace sc_core; struct HelloWorld: sc_module{ SC_CTOR(HelloWorld){ SC_METHOD(m_helloworld); } void m_helloworld(void){ std::cout << "hello world" << std::endl; } }; int sc_main(int, char*[]){ HelloWorld helloworld("helloworld"); sc_start(); return 0; }
编译使用
g++ -I/usr/local/systemc-2.3.3/include -L/usr/local/systemc-2.3.3/lib-linux64 -Wl,-rpath /usr/local/systemc-2.3.3/lib-linux64 -lsystemc helloworld.cpp -o out
Python
print("hello world")