fasked спасибо, т.е. у меня должно получить что-то вроде этого ?
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| int *x;
int *oldx;
size_t size;
x = (int *)malloc( 1 * sizeof( int ) );
for(int i=0;i<10;i++)
{
x[i] = i;
size = _msize( x );
oldx = x; // save pointer in case realloc fails
realloc( x, size + (sizeof( int )));
}
free( x ); |
|