5个c++的概念疑问
1.const data area
global or static data area
stack
free store
heap
分别有什么区别和联系?
2.new delete和malloc free有什么区别?两者分别适合什么时候使用?
new delete :for user-defined data types,it will not only allocate and deallocate memory,but also invoke their ctors and dtors.
这句话的ctor和dtor 的中文意思是什么啊?英文词典查不出来 谢谢了
3.string*p1=new string,*p1="Hello!";和string *p=new string("Hello!");有区别么?如果有的话什么区别啊?
4.static_cast和强制转换有什么区别?
5.
Default Parameter Values
switch on/off debugging
void vec_incre(const vector<int>&vec,ostream*ofile=0)
{
.........
........
if(ofile)
{
(*ofile)<<endl;
}
}
Q: Could we use ofstream&ofile=0?
我觉得是不可以 因为引用不能为空。请问这个Q我回答的对么?
6.printf("%d%d",a,b);printf的参数个数是可变的 这样的可变数量参数的函数是怎么编写的啊?