Hey.
I was wondering when u have a member function foo, what is the diffrence between:
andCode:DWORD static foo();
Thx in advance.Code:static DWORD foo();
Printable View
Hey.
I was wondering when u have a member function foo, what is the diffrence between:
andCode:DWORD static foo();
Thx in advance.Code:static DWORD foo();
No real difference. The static keyword is applied to the function, not the return type.
There's no actual difference at all. That's one of those things that C and C++ doesn't actually care about, but which programmers tend to do just one way for aesthetics.
is the same asCode:void foo( const char* x )
is the same asCode:void foo( char const* x )
We just prefer to read the first form as "a constant char pointer" (which makes more sense in Romanic languages) over "a char constant pointer" or "a char pointer constant".Code:void foo( char* const x )
Hope this helps.
Eh, that's not correct, Duoas. The first two are indeed effectively the same, but the third is different since the const applies to the pointer.
Yoinks!
You are right. :-S
Thx alot, that explains it :D
Fun fact: You should *never* declare
if you ever expect to pass a non-const char** to the function. Visual Studio allows it, but the standard doesn't----in particular, gcc and g++ will throw an error.Code:void foo( const char **x )