Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!rg2c+ From: rg2c+@andrew.cmu.edu (Robert Nelson Gasch) Newsgroups: comp.lang.c Subject: Data Structure question Message-ID: Date: 1 Feb 91 23:16:13 GMT Organization: Class of '91, Carnegie Mellon, Pittsburgh, PA Lines: 25 Please excuse me if this is basic, but I'n no C hack and am having problems with this as I only recently started programming in C. Given the following declarations (excuse the long winded format, but this is the most explicit notation to me) typedef struct{ int data, value, frequency; } datatype; typedef datatype data_array[MAXNUM]; typedef data_array *data_array_pointer; typedef data_array_pointer pointer_matrix_type[MAXNUM]; How do I access the individual data elements once I malloc() the structure? I've been trying to get this right for 2 days by now but managed to produce only system errors. If this were a simple 2 dimensional array, the notation would be array[x][y].data = whatever; Introducing pointers into the data structure makes things harder though, so I have no clue on how to correctly access the cells. If anybody could shed some light on this, I'd greatly appreciate it. Thanx a lot ---> Rob