1 / 36
文档名称:

C++教程.pdf

格式:pdf   大小:2,720KB   页数:36页
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

C++教程.pdf

上传人:jenglot 2022/7/2 文件大小:2.66 MB

下载得到文件列表

C++教程.pdf

相关文档

文档介绍

文档介绍:: .

2;
< > const < >[< >] •
const < > < >[< >] •
int const a[5]={1, 2, 3, 4, 5};
2.
< > const < >
const < > < >
const
1.
const const
char * const prt1 = stringprt1;
ptr1ptr1 = stringprt2;
*ptr1 = "m";
ptr1 ptr1 (
)
const * ptr2 = stringprt1;
ptr2 ptr2 ptr2
*ptr2 = "x";
ptr2 = stringptr2;
const const
const const *
const
2.
const
const < > & < >
const double & v;
C++ const#include
const int N = 6;
void print(const int *p, int n);
void main()
{
int array[N];
for (int i=0; i cin>>array[i];
print(array, N);
}
void print(const int *p, int n)
{
cout<<"{"<<*p;
for (int i=1; i cout<<","<<*(p+i);
cout<<"}"< }
const
const
< > < > (< >) const
const
const
#include
class R
{
public:
R(int r1, int r2) { R1=r1; R2=r2; }
void print();
void print() const;
private:
int R1, R2;
};void R::print()
{
cout< }
void R::print() const
{
cout< }
void main()
{
R a(5, 4);
();
const R b(20, 52);
();
}
5,4
20;52
( ) const
const
const
cons