Re: [Dev-C++] What are the differences between a struct and a class?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Derek C. <de...@ci...> - 2008-12-05 16:30:37
|
In C++ the only difference between a struct and a class is that in a class the default access is private whereas in a struct it is public. in all other aspects they are the same. On Fri, Dec 5, 2008 at 12:43 PM, Andre Macario Barros <and...@su...> wrote: > Dear users, > > When we need to develop a OO app, one way is to create > classes, with attributes and methods. After this we instanciate > the class in our program, as it is, or with some specialization. > > Thinking only about ANSI-C, we can create structs with the > usual fields (attributes), but we can associate functions inside > the struct too. After this operation, putting this struct definition > in a .h file, we can make a variable declaration defining it as > a struct type (the one created in the .h file). > > In this scenario, disconsidering the protected/public/private > features, please talk to me abou what a OO app can > do that a struct like .c program can´t. > > Regards > Andre > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |