home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!smurf.sub.org!incom!orfeo!eric
- From: eric@orfeo.radig.de (Eric Tuerlings)
- Subject: pointer to araay of structs
- Message-ID: <BtICrz.5pB@orfeo.radig.de>
- Summary: how to use: void (struct aaa (bbb *)[]) ?
- Keywords: pointers
- Organization: Peter Radig EDV-Beratung, Frankfurt am Main, Germany
- Date: Mon, 24 Aug 1992 21:52:46 GMT
- Lines: 33
-
-
- Hello world,
-
- I've encountered a small problem with our (ANSI) Microtec C cross compiler.
- See this small piece of code below:
-
- struct aaa {
- char y;
- char z;
- }
-
- void func (struct aaa (*bbb)[])
- {
- char z;
-
- z = bbb[3]->ccc;
- }
-
- in which bbb is a pointer to an array of aaa structures. The compiler
- complains about an unknown size. If I give the array a dimension, the
- compiler doesn't complain, but that is not what I want. I want func to
- handle different array sizes. Ok I know that I simply can leave out the
- square brackets, and use some casting in func, but that is not wat I want
- too. I like to tell the compiler that func must accept pointers to _arrays_
- of aaa structures.
-
- I've had contact with the Microtec hot line in Gemany. (Ottobrun/Munich)
- Still awaiting their answer, I like to hear from people on the net what they
- think about this C problem. It is possible that my C knowledge is the problem.
- (At least the lack of it -)
- --
- Eric Tuerlings,Stresemannallee 63,6000 Frankfurt am main(argc,arcv) 70,Germany.
- Tel: +49 69 6316870, E-Mail: eric@radig.de ---- Leben wie ein Gott in Frankfurt
-