FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/Method_implementation

Class implementation file

In object-oriented programming, a class implementation file is often used to contain the implementation code for the method(s) of a class. Programming languages like C++ and Objective-C make use of these implementation files so as to separate the interface and implementation of these methods.

ExampleClass.cpp would look like this:

exportmodulewikipedia.examples.ExampleClass; importstd; usingstd::string; exportnamespacewikipedia::examples{ classExampleClass{ private: stringname; public: ExampleClass();// Constructor. voidaddSomething(intk); }; }

In Main.cpp file like so:

Alan Griffiths (2005). "Separating Interface and Implementation in C++". ACCU. Retrieved 2013-05-07.
  • ↑ "C++ Dos and Don'ts". The Chromium Projects. Retrieved 2013-05-07.
  • ↑ Febil Chacko Thanikal (2009). "How to define a template class in a .h file and implement it in a .cpp file". Code Project. Retrieved 2013-05-07.
  • ↑ Neuberg, Matt (26 May 2011). "Chapter 4.3 Header File and Implementation File". Programming iOS 4. O'Reilly Media, Inc. ISBN 978-1-4493-8843-0.
  • ↑

  • View original on Wikipedia | Back | FazBrowse Home