What is the widely accepted naming convention for c++ ? (functions, classes, parameters, local variables, namespaces, etc)
I don't think there is a "widely accepted" naming convention in C++. Stroustrup's books and papers generally has the following coding style:
class Shape {
public: // interface to users of Shapes
virtual void draw() const;
virtual void rotate(int degrees);
// ...
protected: // common data (for implementers of Shapes)
Point center;
Color col;
// ...
};
You also may want to look at popular style guides like The Google C++ Style Guide.
It depends somewhat on the platform. For example, MFC applications have a certain naming style (which I happen to follow), others use a different style.
Sort of like different C++ "cultures".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With