1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
* |
There are three equivalent ways of making a non-default size stack: |
||||||||||||||||||||||||
|
Istack s1(500);
|
// or
|
||||||||||||||||||||||||
|
* |
Here are some other equivalent declarations: |
||||||||||||||||||||||||
|
char s[] = "hello";
char s[] = {"hello"};
char* s = "hello";
|
|
||||||||||||||||||||||||
|
int i = 5;
|
// or |
||||||||||||||||||||||||
new and delete vs. malloc() and free() |
|||||||||||||||||||||||||
|
If T is some type in your program (char, int, double, or some
|
|||||||||||||||||||||||||
|
tp = new T; |
// equivalent to: |
||||||||||||||||||||||||
|
tp = (T*) malloc (sizeof (T)); |
|||||||||||||||||||||||||
|
16-Mar-98 |
Page 12 |
C201/TAM/AGS |
|||||||||||||||||||||||