在C,我做 int (*ptr)[100];
ptr=malloc(sizeof *ptr); // this is the easy/error proof way of doing it
是否有這樣做的錯誤證明C++的方式與new操作 int (*ptr)[100];
ptr=new __what_comes_here?
我想知道是否有人可以幫助我解決一些混亂,我有獨特的指針。請看下面的代碼: // some class "complex" defined here
int main()
{
while(1)
{
unique_ptr<complex> p(new complex[256]);
p.reset();
}
return 1;
}
function player(name, goals, games) {
this.name = name;
this.goals = goals;
this.games = games;
}
var ricky = new player('Ricky', 7, 15);
var tom = new player('Tom', 15, 17);
var p