On 28 Dec 95 02:54, andrew clarke wrote to Kieran Haughey:
Hi andrew,
ac> 24 Dec 95 14:24, Kieran Haughey wrote to Paul Edwards:
>> I just managed to do a successful example taking keys from the
>> keyboard and loading them into an array of 30 characters, which would
>> realloc itself after every 10..
ac> Send code!
You want me to send you the code of how I got realloc to work on a buffer??
:).. although I will admit I never printed the complete result afterwards,
so the data garbling I'm having with reallocing an array of structs may
have occurs with the buffer I used for the test.. ...
#include
#include
int main()
{
char *buffer;
int x=0;
unsigned int arr_cur_size=0;
buffer = calloc(10,sizeof(char));
for(x=0;x<30;x++)
{
if(x * Origin: -=> The Last Stand Against Sanity <=- (3:711/413.17)
SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 420 423 430 510 808 809
SEEN-BY: 711/932 934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 711/413 808 809 934
|