开发者

C++ / Objective-C : The two files of a class are called Header and ...?

开发者 https://www.devze.com 2023-01-06 22:41 出处:网络
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 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 a开发者_如何学Cnd I have no idea.


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 official naming guideline


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


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


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


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


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"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号