Which naming convention is more
preferable in C++? The `underscore'
method or the camelCase method? I have
coded in Java for a while and I am
used to the camelCase naming
conventions. Which one is more
prevalent?
I'd say 'just stick with what you know on this if you are starting to write your own libraries', they are both used regularly.
Also, while defining a class, is there any preferred ordering of private/public/protected variables/methods?
This varies by programmer/team. I order by category. I use a category for 'internal/private methods', and that category is generally second to last (the last being prohibited implementation).
Are friends usually put in the end?
I use them rarely; I insert them above the dependency (method), otherwise, after the constructor/destructor category.
What about typedefs, do they come at the top of the class definition?
That is where I put them.
If you want to get into details, there are publicly available coding conventions. Since you already have a Java background, you'll easily be able to cut through the 'taste' in them.