Caution!!!


Do With Your Own Risk


#include <iostream> 
#include <new>
#include <conio.h>
using namespace std;

int main ()
{
  int i,n;
  int * p;
  cout << "How many numbers would you like to type? ";
  cin >> i;
  p= new (nothrow) int[i];
  if (i == 0)
    cout << "Error: memory could not be allocated";
  else
  {
    for (n=0; n
    {
      cout << "Enter number: ";
      cin >> p[n];
    }
    cout << "You have entered: ";
    for (n=0; n
      cout << p[n] << ", ";
    delete[] p;
  }
   getch();
  return 0;
 
}
 

Artikel yang terkait dengan kategori:




Komentar melalui Facebook:
cara memasang Facebook Comment?

0 komentar :

Posting Komentar

boleh copas tapi cantumkan sumber linknya ya ... ^^



Copyright 2010 Hermawan's IT Blog.
Lunax Free Premium Blogger™ template by Introblogger