Re: create an object with variable CLASS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mohsen

> My main file:
> int main(){
> module_management *x;
> x.printg();
> }

In your code, x is a wild pointer.

You need to do either:

int main()
{
  module_management x;
  x.printg();
}

Or:

int main()
{
  module_management* x = new module_management;
  x->printg();
  delete x;
}

(You can replace new module_management with some other suitable factory
function that you have written.)

HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux