|
| Bazzy (4093) | |||
LOL:
| |||
| chrisname (2468) | ||
That's impossible, p is a pointer to void, not a pointer to a pointer... Edit: But... it compiles! It doesn't segfault! I can print the address of p! HOW? | ||
Last edited on | ||
| Bazzy (4093) | |
| A pointer to void can point to any type | |
| chrisname (2468) | |
| OH. | |
| firedraco (2540) | |
I name my classes like this:class object;and make instances of them like this: object Object;^_^ | |
| Bazzy (4093) | |
| I do the opposite | |
| TaikoDragon (27) | |||||
I use Camel case then naming my classes:class SomeObjectClass;and variables(local and global) + member functions like this:
non-member functions and namespaces use Camel case just like classes. I will suffix most points with "Ptr" unless it's very local which then I assume you read the declaration.
also I group the "*" with the type unless I'm making more than once declaration on the line. | |||||
Last edited on | |||||
| computerquip (859) | |
| Strange as it is, my C and C++ code conventions are different. For C, I go with gnome's crappy way of function naming eg.: this_is_a_very_long_function_lol( int * thisIsAVariable) compare to my C++ stile which goes something like int * SetRotation( int *pNumber). The C++ may have no lower case variables depending on it's status. If it's global, it starts with a g eg gGlobal. If it's just some random stack fiend, it goes something: int MyVariable; This is just something I grew into I guess... | |
| jsmith (3728) | |
| I'm a bit behind on this thread, but... @chrisname: You should never define your own symbols that begin with underscores; all such symbols are reserved by compilers and/or library writers. There are in many cases programmatic solutions to preventing "internal" functions from being called. Make "internal" class member functions (if they need to be class members) private. For free functions that are used in a single .cpp file, do not declare them in the header; rather make them static functions in the .cpp file and/or put them in an unnamed namespace within the .cpp file. | |
| chrisname (2468) | ||
That's what I use them for; so that people won't call functions I don't want them to. However I will take your advice and make them static. | ||
Pages: [1] [2]
This topic is archived - New replies not allowed.
