home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!caen!malgudi.oar.net!news.ysu.edu!do-not-reply-to-path
- From: ae007@yfn.ysu.edu (Daniel Newcombe)
- Subject: void pointer to a struct?
- Message-ID: <1992Nov10.220944.1810@news.ysu.edu>
- Sender: news@news.ysu.edu (Usenet News Admin)
- Nntp-Posting-Host: yfn.ysu.edu
- Organization: Youngstown State University/Youngstown Free-Net
- Date: Tue, 10 Nov 1992 22:09:44 GMT
- Lines: 14
-
-
- Hi, I have a struct te { int i; char c}
- In the main part of the program I have the variable r declared
- as type te. I also have j as type char. I then have
- void *o in there. At first I have o point to j and do
- a printf("%c",*(char *)o) and this works. How would I use
- o to point to r, and be able to print the c field?
- Thanks...
- -Dan
- --
- -Dan Newcombe
- Internet Address: STDN@VM.MARIST.EDU
- Youngstown Freenet: ae007@yfn.ysu.edu
- GOAL: To put the world on 3.5" diskettes... :)
-