Knowledge Structure:
1, If,for,switch,goto
2, #define, const
3, File copy code, dynamic generation of memory, compound expression, strcpy,memcpy,sizeof
4, function parameter transmission, memory allocation mode, memory error performance, malloc and new difference
5, class overload, hide and overwrite difference, extern problem, function parameter default value problem, macro code and inline function difference
6. Order of construction and deconstruction, string function definition
Specific implementation:
1, If,for,switch,goto
if:
bool int float pointer char How to use variables
bool bParam;
int iParam;
float fParam;
int* pParam;
char cParam;
if(bParam) ,if(!bParam);
if(iParam == 0 ),if(iParam != 0 );
if(fParam>= -0.00001 && fParam <= 0.00001);
if(pParam == NULL),if(pParam != NULL);
if(cParam == '\0'),if(cParam != '\0');
How to use If/else/return
if(condition) Can be equivalent toreturn (condition?x:y);
{
return x;
}
else
{
return y;
}
for: