Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!mahendo!nereid!robert From: robert@nereid.jpl.nasa.gov (Robert Angelino) Newsgroups: comp.lang.c Subject: Casting diff structures to char* Message-ID: <6214@mahendo.Jpl.Nasa.Gov> Date: 13 May 91 02:33:33 GMT Sender: news@mahendo.Jpl.Nasa.Gov Reply-To: robert@triton.JPL.NASA.GOV Organization: Technology Development Group (JPL) Lines: 46 I've written a function that takes a char* pointer to different structs that have a common named var (which I'm accessing in this function). I've included an example. struct one { int a, rnum; }; struct two { char b; int a, rnum; }; my_func(rec,...) char *is_this_correct; . . . { is_this_correct->rnum = ... } my_func((char*) &a,...); my_func((char*) &b,...); This is the error I'm getting "nonunique name demands struct/union or struct/union pointer". I keep getting this error in my_func where I try to access rec->rnum. Am I doing this correctly?? Thanks in advance and any suggestions are welcome. -- - ------ - Robert Angelino | | | ---- \ | | ms T-1704L | | | | \ | | | 4800 Oak Grove Drive | | | | -- | | | Pasadena, CA 91109 ---| | | | \__/ | |___ robert@triton.jpl.nasa.gov \____|et |_|ropulsion |_____\aboratory (818) 354-9574