C++总复习经典
string是C++专用的字符串类,编程时建议用它来保留字符串而不是字符数组,使用它的时候,要包括名为string的头文件。c_str();string+stringsrtcpy()size()length()查帮助文档string(char[]);intatoi(constcharstr)这个函数可以把string转换为int类型,例如:inti=atoi(12345);这条句子的意思是把12345这个字符串转换为int类型并用其初始化变量i;read()文件——gt;内存write(,char
,)字符数组结构struct一:效果:首要用来封装一组纷歧样类型的数据:使用注意<imgsrc="sad.gif"smilieid="2"border="0"alt=""/>1):各个成员在内存中的存储纷歧定是连续的。(与数组的区别)(2):可以有结构函数和别的的函数,可是通常都不写(3):属性和方法也可以用private,public,protected修饰,可是默以为public,通常状况下不写。
C++总温习.doc
本资源由资源海IT资料站收集。
(String is a special string class for C++. It is recommended to use it to retain strings rather than character arrays during programming. When using it, you should include a header file named string. c_ str(); String+stringsrtcpy() size() length() Look up the help document string (char []); intatoi(constcharStr) This function can convert string to int type, for example: int i=atoi (12345); This sentence means to convert the string 12345 to the int type and use it to initialize the variable i; Read() file -- gt; Memory write (, char
,) Character array structure struct I: Effect: It is mainly used to encapsulate a group of data of different types: Note:<imgsrc="sad. gif" smilieid="2" border="0" alt=""/>1): The storage of each member in memory is inconsistent. (Difference from arrays) (2): There can be structure functions and other functions, but they are usually not written (3): Attributes and methods can also be decorated with private, public, and protected, but the default is public, and they are usually not written.
C++Total Review.doc
This resource is collected by the IT data station of Resource Sea.)
页:
[1]