C and C + + language learning Summary (i)

Source: Internet
Author: User
Tags bool file copy function definition goto

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:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.