전 systemc에서 새로운 기능입니다. 내가 가지고있는 혼란이 하나 있습니다.SystemC 생성자, 클래스
나는 sc_module(hello_world)
을 생성 중입니다. sc_ctor(hello_world)
에는 중괄호 사이에 아무 것도 없으며 "hello world"를 인쇄하는 모듈 안에 간단한 void say_hello()
기능이 있습니다.
hello_world hello;
hello.say_hello();
그러나, 나는이 시도 error C2228: left of '.say_hello' must have class/struct/union.
없다는 오류를 얻고있다 그것은 일 : 다음 sc_main
에서
, 내가이 짓을
을 sc_main
에, 나는 이런 짓을 :
hello_world hello("hi ");
hello.say_hello();
왜 오류가 표시되는지 처음부터? 하나의 인수 생성자를 사용하지 않았습니다.
hello_world hello("hi ")
대신 hello_world hello
일까요? 저는 C++ 클래스와 비교하려고했습니다.
안녕하세요, 전체 모듈 및 기본 코드를 게시 할 수 있습니까? –