- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
class array
{
int data[256];
int p;
public:
array ():
p (0)
{}
array & operator , (int a)
{
data[p++] = a;
return *this;
}
array & operator = (const array & arr)
{
p = 0;
memcpy (data, arr.data, sizeof (data));
return *this;
}
int & operator [] (size_t i)
{
return data[i];
}
};
#define _I array(),
#define I_
#define o_O ,
int _tmain(int argc, _TCHAR* argv[])
{
array arr;
arr = _I 1,2,3,4,5,6 I_; // init
arr o_O 7,8,9,10; // append new
arr o_O 11 o_O 12; // append new
}