help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about "new" and "delete" ?


From: jack
Subject: question about "new" and "delete" ?
Date: 5 Mar 2005 19:11:31 -0800
User-agent: G2/0.2

the following code can be run and can generate result:
a[9]=10;
what happend there?
int main()
{
  double *a= new double[10];
  for(int i=0;i<10;i++){
    a[i]=i+1;
  }
  delete [] a;
  cout << a[9] << endl;
  return 0;
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]