Program Language Plus

怎样传递二维数组指针?

int f(int **pIntArray, int nRow, int nCol);

* [ ] 意义及结合率 

 

个人关于C++语言的一些回顾

--------------------------

Q: new delete

A:when create a new-expression,two things  occur.

First,storage is allocated using the operator new();

Then,the constructor is called.

In a delete-expression,the destructor is called,then storage is deallocated using the operator delete();

Q:storage

·heap:

you use the heap when you don't know the size of the memory you'll need while you're writing a program.That means [allocate at runtime][dynamic-memory]

·stack:

In the ordinary case,when extern is not part of the definition,no storage is allocated.[Normally,the C++ compiler avoids creating storage for a const,but instead holds the definition in it's symbol table].when the const is used,it is simply folded in[调入] at compile me.

 

 

 

 

 

 

 

 

 

 

· ASCII 

It currently defines codes for 128 characters: 33 are non-printing, mostly obsolete control characters that affect how text is processed, and 95 are printable characters.

ASCII is, strictly, a seven-bit code, meaning it uses patterns of seven binary digits (a range of 0 to 127 decimal) to represent each character.

ASCII is embedded in its apparent replacement, Unicode, as the lowest 128 characters.

·text file:

At this generic level of description, there are two kinds of computer files: 1) text files; and 2) binary files.

Some programs go to great lengths to "guess" the encoding by looking for patterns in the text file, but this guessing procedure is very difficult to specify correctly for all cases

The precise definition of the .txt format is not specified, but typically matches the format accepted by the system terminal or simple text editor. Files with the .txt extension can easily be read or opened by any program that reads text and, for that reason, are considered universal (or platform independent).

In particular, on Unix systems, where extensions are entirely optional, it's common to see text files with no extension at all, the most prominent example being the README file, present in many software packages. However, there's no difference between a plain text file with no extension and a .txt file. The term "plain text" is attributed to the contents of the file, while the term ".txt" is attributed to the file metadata (i.e. the extension).

Unicode is an attempt to create a common standard for representing all known languages, and most known character sets are subsets of the very large Unicode character set. Although there are multiple character encodings available for Unicode, the most common is UTF-8, which has the advantage of being backwards-compatible with ASCII:

const

As a matter of practice,if you think a value shouldn't change,you should make it a const.This not only provides insurance against inadvertent change,it also allows the complier to generate more efficient code by eliminating storage and memory reads.

 

 Q:pointer 地址位 内存

 

 Q:corners in class

this:...cout<<"this="<<this<<endl;

XClass* xp;   xp->XClass::~XClass( );    //Explicit destructor call

Q:unsigned char V.s char  空间大小 基本数据类型 位操作 string 

const int size Vs int const size ..

int const* q = new int[10]; //const bind

const int* q = new int[10];  //with int  , q++ is ok

int * const q = new int[10]; //q++ is illegal(not ok)

Q:namespace  

Q:exception throw try catch

Q:字符串问题
A:用字符串地址进行输出时,按连续地址算,碰到/0时终止,不然持续往后算,直到地址空间中出现/0(垃圾值).
如果想用地址输出一个字符数组,字符数组大小须比字符个数多1,用于存储"/0"

双引号中叫character array,[ASCII] terminate with the value 0 . string是Standard C++ library. 

C++ strings greatly reduce the likelihood of making three of the most
common and destructive C programming errors: overwriting array bounds, trying to access
arrays through uninitialized or incorrectly valued pointers, and leaving pointers “dangling”
after an array ceases to occupy the storage that was once allocated to it.

 Q:namespace std    cout    iostream

the operator << is overloaded with a variety of meaning when used with cout, you can send cout a variety of different arguments and ...

 

Q:quality质量,品质  quantity数量

... 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值