CompuServe Messages

C/AllocMem()

    26-May-90 10:47:06
Sb: #106383-C/AllocMem()
Fm: Khalid Aldoseri 75166,2531
To: Tom Gray 72701,1447
Tom, you could use a *array[20] and then allocate memory for each line as you read it in. e.g… while (string = read(file) { arraypointer[x] = (char *) AllocMem(strlen(string)); strcpy(arraypointer[x],string); x++; } (this is not real code, by the way, but I hope it shows what I mean) The good thing about this code is that it allocates less memory in total than 40 bytes per line. Of course, its limitation is that you cannot then edit the lines if you need to. Khalid.