home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!ogicse!orstcs!orstcs!usenetusenet
- From: warninm@xanth.CS.ORST.EDU (Michael Warning)
- Newsgroups: comp.lang.c
- Subject: Ragged arrays of type long?
- Message-ID: <1992Aug15.052649.20308@CS.ORST.EDU>
- Date: 15 Aug 92 05:26:49 GMT
- Article-I.D.: CS.1992Aug15.052649.20308
- Sender: usenet@CS.ORST.EDU
- Organization: Oregon State University
- Lines: 24
- Nntp-Posting-Host: xanth.cs.orst.edu
-
- Is it possible to create a ragged array of type long? My references goes on
- for two pages about how neat ragged arrays of strings are, but says nothing
- about any other data type.
-
- For example:
-
- static char *try1[] = {"abc",
- "wxyz"};
-
- This works fine, but:
-
- static long *try2[] = {{1, 2, 3},
- {5, 6, 7, 8}};
-
- This causes the various flavors of MS-C that i've tried to come up with a
- 'Different levels of indirection' error. This is the only syntax that I
- could come up with that made sense.
-
- So is there any way to do this easily, or am I stuck with manually allocating
- memory for each row and setting each element individually? Please respond
- via e-mail as I don't normally read this group.
-
- Thanks,
- -Mike
-