PDA

View Full Version : What's up with these "C" prefixes?



crazyfuturamanoob
June 5th, 2009, 03:50 PM
Half of source files in LieroX got this weird prefix, like CInput.h, CMap.h, CChatBox.h etc.

Other games/programs got those prefixes too. Why is that? What is that C supposed to mean? Client? Core?

Edit: Quake doesn't have those prefixes. It's just c++ stuff.

simeon87
June 5th, 2009, 03:50 PM
Class, most likely.

x33a
June 5th, 2009, 04:12 PM
in c++, headers such as cstdlib, mean c++ version of the c headers such as stdlib.h.

i cannot say if it stands true for the games too.

nvteighen
June 5th, 2009, 07:13 PM
Er... and how can that detail be important, I ask?

Reiger
June 5th, 2009, 07:32 PM
Prefixes like that are often used to create ad-hoc namespace convetions especially in languages which do not sport formal namespace declarations...

But sometimes the same thing is done to link various items that 'belong' together without being in the same class/namespace whatever: essentially the concept of Hungarian notation. Things prefixed the same `do the same kind of thing'. Useful if you have for instance relative and absolute offsets to be calculated relative or absolute to a Window pane (and not a conceptual 3D coordinate system): you could have WOffset() and COffset() to denote the conceptual difference.