C++ Help ...

Susan Macchia linux-sxs at sbmgarden.com
Fri Aug 14 17:48:59 PDT 2009


-----------------------------------------------------------
> 
> 
> What does the "FileMgr::FileMgr(c..." mean to a C programmer like me?
This is the constructor of the FileMgr class.  In other words when 
memory is allocated for an instance of the object, the constructor 
(ctor) is called.
> 
> Embedded in the that code is  "DiskMgr::read(fd, ...."  whatd does that
> mean and do?
There is the notion of static methods on a class, which are accessible 
by "anyone".  By "static" it means sort of "global".  All methods of a 
class get an implicit variable called "this" which is a pointer to the 
object upon which the method was called.  Static functions are global 
class functions accessible by any other class and as such, don't have an 
implicit notion of "tjis"
> 
> And finally, there is this at the bottom: "FileMgr::~FileMgr(void)"
> What does that do?
That is the destructor of the class.  When the memory gets deleted it 
gets called.
> 
> Thanks ...
> 
> 

You should really read stroustrup's C++ book 
(http://www.amazon.com/Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_1?ie=UTF8&s=books&qid=1250297202&sr=8-1) 
or Lipman's C++ book 
(http://www.amazon.com/Primer-4th-Stanley-B-Lippman/dp/0201721481/ref=sr_1_1?ie=UTF8&s=books&qid=1250297169&sr=8-1). 
  It would really help.  An understanding of OO is important if you're 
going to design/write anything in C++.

HTH,
Susan

P.S. I've been developing OO software for over 15 years, & C++ for 12, 
so if you want to ask me questions offline, feel free to ask.  I urge 
you to review the books above and to become acquainted with OO 
terminology and thinking.
-- 
__________________________
Susan Macchia
mailto:linux-sxs at sbmgarden.com
http://www.sbmgarden.com
__________________________



More information about the Linux-users mailing list