delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/28/05:07:00

Message-id: <fc.000f77f3000fcb993b9aca00171f4fd6.fcba9@bni.mg>
Date: Mon, 28 May 2001 11:45:38 +0300
Subject: Re: RE: Re(2): Array of poiters to an Array
To: djgpp AT delorie DOT com
Cc: djgpp AT delorie DOT com
From: "NirinaMichel Ratoandromanana/DF" <n DOT ratoandromanana AT bni DOT mg>
References: <F6E7432DD437D511AD92009027C3AAC466B978 AT headoffice DOT umgeni DOT co DOT za>
In-Reply-To: <F6E7432DD437D511AD92009027C3AAC466B978@headoffice.umgeni.co.za>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

It does! Thanks.

>One way is to try declaring an array of pointers
>char **array_of_pointers[];
>Now you need to malloc enough space for the number of string pointers you
 
>need
 
>array_of_pointers = (char 
*
>)malloc(number_of_strings*sizeof(char *));
>Next allocate each of these pointers enough space to hold the required
 
>string
>array_of_pointers[0] = (char *)malloc(size_of_string1*sizeof(char));
>array_of_pointers[1] = (char *)malloc(size_of_string2*sizeof(char));
>etc...
>You can fill these arrays with code like
>array_of_pointers[0] = "my string";
>Hope this helps ?:)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019