views:

95

answers:

6

In languages like C++ or Objective-C a class normally consist of two files. The first is called Header or Interface but what is the "official" name of the other file?

In some books it's just called "Codefile" in other "implementation file" or "message file" for Objective-C. Which name is the right name? I need to write a tutorials and I have no idea.

A: 

In the classes I have taken taught with C++ the term for the .cpp file that had the function definitions was always the implementation file. The book used was "Big C++" by Horstmann http://www.horstmann.com/bigcpp.html

Jordan
A: 

I would say that "implementation file" or "definition file" are OK. But I don't think they can be considered "official" names.

Pablo Santa Cruz
+5  A: 

In C++, I always use these terms:
- "Header file" for the .h or .hpp file
- "Source file" for the .cpp or .cxx file
but I don't think there is a real offical naming guideline

Seb Killer
A: 

The clearest way: ".cpp file" or ".c file"

Igor Oks
And what if the extension is `.cxx`, `.cc` or `.C`?
Philipp
Just use ".cxx file" or ".cc file" or whatever it really is. Usually you will only have one of them in each context. Otherwise, e.g. if you use something like "Source file", you will have to deal with ambiguity because for some people Header file is a Source file too.
Igor Oks
or `.m` or `.mm`
JeremyP
A: 

There is no "official" name since the only thing which could make it official is the C++ Standard (which actually puts no meaning at all the file extensions)

I usually call it the "source file" or the "cpp file"

James Curran
+4  A: 

I always refer to them as "header files" and "implementation files".

mipadi