Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ENUXHA.EAS.ASU.EDU!trotter From: trotter@ENUXHA.EAS.ASU.EDU (Russell T. Trotter) Newsgroups: comp.lang.c Subject: Novice question about malloc and pointers Message-ID: <9104171614.AA14362@enuxha.eas.asu.edu> Date: 17 Apr 91 16:14:59 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: trotter@enuxha.eas.asu.edu (Russell T. Trotter) Organization: Arizona State Univ, Tempe AZ Lines: 10 I am trying to get an array of strings, therefore I am using the following declaration: char *str[MAX] where MAX is an arbitrary constant. My question is how do I allocate the memory for each character position? Do all the characters strings for each element in the array need to be allocated contiguously? The problem involves reading in lines of input. Each line would be stored as a string and the number of lines make up the number of elements in the array. Any information would be greatly appreciated. Thank you. trotter@enuxha.eas.asu.edu