Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Or a small question about C++
Or a small question about C++
The variable size in1.constint size =15 cannot be changed.

The size in int SiZe= 15 can be changed.

Const is a keyword in C language, which restricts a variable from being changed. Variables starting with const are so-called read-only variables. Please note that variables cannot be changed in the program after they are added.

2. The difference is that the first pass of the function is a constant. 3. The second pass is a formal parameter, that is, you can pass an argument to the function.

3.int

Long integer

Short integer

Unsigned integer

Unsigned short integer

Unsigned long integer

__int 16

__int32

__int64

flotage

tea

double;twofold

Long double

4.sizeof is an operator that can be used for any variable name, type name or constant value. When it is used for variable names (not array names) or constants, parentheses are not needed.

For example: sizeof (int a); Is to find the length of the integer a.

5.# include & ltassert.h & gt// Set the insertion point.

# include & ltctype.h & gt// character processing

# include & lt error number & gt// Define the error code.

# include & ltfloat.h & gt// floating point number processing

# include & ltfstream.h & gt// file input/output

# include & ltiomanip.h & gt// parameter input/output

# include & ltiostream.h & gt// data stream input/output

# include & lt limit. & gt// Defines the maximum constants of various data types.

# include & ltlocale.h & gt// Define localization function.

# include & ltmath.h & gt// Define a mathematical function.

# include & ltstdio.h & gt// Define input/output functions.

# include & ltstdlib.h & gt// Define miscellaneous functions and memory allocation functions.

# include & ltstring.h & gt// string processing

# include & ltstrstrea.h & gt///Array-based input/output

# include & lttime.h & gt// Define a function about time.

# include & ltwchar.h & gt// Wide character processing and input/output

# include & ltwctype.h & gt// wide character classification

//////////////////////////////////////////////////////////////////////////

Standard C++ (same as above, no comments)

# include & lt algorithm & gt//STL general algorithm

# include & ltbitset & gt//STL bit set container

# include & ltcctype & gt

# include & ltcerrno & gt

# include & ltclocale & gt

# include & ltcmath & gt

# include & lt Complex & gt// Complex class

# include & ltcstdio & gt

# include & ltcstdlib & gt

# include & ltcstring & gt

# include & ltctime & gt

# include & lt dirk & gt//STL queue container

# include & lt exception & gt// exception handling class

# include & ltfstream & gt

# include & lt Functionality & gt//STL defines an operation function (not an operator).

# include & lt restrictions & gt

# include & lt list & gt//STL linear list container

# include & lt map & gt//STL mapping container

# include & ltiomanip & gt

# include & ltios & gt// Basic input/output support

# include & ltiosfwd & gt// Pre-declaration used by input/output system

# include & ltiostream & gt

# include & ltistream & gt///basic input stream

# include & ltostream & gt///basic output stream

# include & lt queue & gt//STL queue container

# include & ltset & gt//STL collection container

# include & ltsstream & gt// String-based stream

# include & lt stack & gt//STL stack container

# include & ltstdexcept & gt///standard exception class

# include & ltstreambuf & gt///underlying input/output support

# include & lt string & gt// string class

# include & lt utility & gt//STL generic template class

# include & ltvector & gt//STL dynamic array container

# include & ltcwchar & gt

# include & ltcwctype & gt

Use namespace std

6.strlen is a function to calculate the length of a string.

strlen prototype:extern int strlen(char * s);

Usage: # include

Function: Calculates the length of the string S (unsigned int type).

Description: Returns the length of s, excluding the terminator NULL.

For example:

// strlen.c

# include & ltsyslib.h & gt

# include & ltstring.h & gt

Master ()

{

Char *s= "golden global vision";

clr SCR();

Printf("%s has %d characters ",s, strlen(s)););

getchar();

Returns 0;

}

Strlen()+ 1 means adding 1 to the obtained length value.