Code: Select all
void func1();
void func2(void);
void func3(...);
In C++: func1 is equivilent to func2 - that is, empty parentheses indicate the function takes no parameters, since C++ decided to do away with compatibility with really old C.
Code: Select all
void func1();
void func2(void);
void func3(...);
No, it isn't.Owen wrote:Thats a C legacy.
In C: func1 is equivilent to func3, as in, pass all the parameters you want and theres no parameter checking. func2 accepts no parameters and will generate a compile error if you pass one. This is a legacy of the really early C compilers where function definitions couldn't have parameters in them.Code: Select all
void func1(); void func2(void); void func3(...);
In C++: func1 is equivilent to func2 - that is, empty parentheses indicate the function takes no parameters, since C++ decided to do away with compatibility with really old C.
All S-structures (any code construct that is delimited by braces "{ ... }") have their open and close bracers on their own lines. Examples:
Code: Select all
namespace Ogre { ... } class Class { .... }; if (true) { .... }
Does anyone have that PDF and can post it?
Code: Select all
ID3D11ShaderResourceView *getTexture()
{ assert(mpShaderResourceView); return mpShaderResourceView; }
Code: Select all
ID3D11ShaderResourceView *getTexture()
{
if(!mpShaderResourceView)
{
LogManager::getSingleton().logMessage("ID3D11ShaderResourceView::getTexture: mpShaderResourceView is NULL");
assert(0);
}
return mpShaderResourceView;
}
Code: Select all
assert(mpShaderResourceView && "ID3D11ShaderResourceView::getTexture: mpShaderResourceView is NULL")
Has anyone ever noted the erratum in 'include'?Example 11. C++ Style Headers
Code: Select all
#inclue <cstring> // Acceptable #include <string.h> // UNACCEPTABLE
Gives 404:wumpus: wrote: A preliminary version can be found here:
http://temas.obelisk.net/ogre/CR/docs/howto.html
Looks like the link has been broken for at least 2 years (way back machine says it was broken in 2014).raffamaiden wrote:Gives 404:wumpus: wrote: A preliminary version can be found here:
http://temas.obelisk.net/ogre/CR/docs/howto.html