Ganesan R

Can tell why this program not running?

2 posts in this topic

Dear Sir,

 

I am new to System C. The problem is number of forums offering support to system c problems are few. As such I want help in understanding why this elementary program is not compiling. It returns  error C2039: 'con_arrayfifo' : is not a member of 'arrayfifo'.

 

Now the program:

 

#include <systemc.h>
SC_MODULE(arrayfifo)
{
    
    SC_CTOR(arrayfifo) {
        SC_METHOD(con_arrayfifo);


    }


};

void arrayfifo::con_arrayfifo (void) {

    //delcare the fifo
    //sc_fifo<int> rowfifo[n];

}


int sc_main(int , char*[] )
{
    int m,n;
    cout << "Sadguru Jai Jai \n";
    cout << "Enter the value of m: \t";
    cin >> m;
    cout << "Enter the value of n: \t";
    cin >> n;
    cout << m <<"\t" << n <<"\n";
    arrayfifo arrayfifo1("arr_fifo");
    //con_arrayfifo(m,n);
    //sc_fifo<int> rowfifo[n];
    return 0;
}

 

The commented lines are intentional to find out why this program is not compiling.

Thanks in advance for your patience and reply back.

 

R. Ganesan

 

Share this post


Link to post
Share on other sites

Well, it's not compiling because con_arrayfifo is not a member of arrayfifo...

You should declare it as a method in class body.

 

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