[ create a new paste ] login | about

Link: http://codepad.org/BvHyTPs6    [ raw code | output | fork ]

C++, pasted on Sep 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
 
using namespace std;
 
int main()
{
  int *a = new int[5];
  int *b = new (int[5]);
 
  int n = 5;
  int *c = new int[n];
  int *d = new (int[n]);
 
  return 0;
}


Output:
1
2
3
In function 'int main()':
Line 12: error: ISO C++ forbids variable-size array
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: