Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!mahendo!nereid!robert From: robert@nereid.jpl.nasa.gov (Robert Angelino) Newsgroups: comp.lang.c Subject: casting ints and floats to char* Message-ID: <6185@mahendo.Jpl.Nasa.Gov> Date: 25 Apr 91 00:10:47 GMT Sender: news@mahendo.Jpl.Nasa.Gov Reply-To: robert@triton.JPL.NASA.GOV Organization: Technology Development Group (JPL) Lines: 35 Hello C people, I'm trying to have a char* array point to different types, i.e hold addresses of ints,floats, and longs. I want to be able to do the following: void has_to_be_done_this_way() { char *ptr[12]; int i; long j; double p; ptr[0] = &i; ptr[1] = &j; ptr[2] = &p; sscanf(buf,"%2d %5ld %15lf",&(*ptr[0]),&(*ptr[1]),&(*ptr[2])); } I hope I'm conveying myself clearly--that's what I'm trying to do. Does anyone have any suggestions?? thanks in advance p.s. Please e-mail me directly. -- - ------ - Robert Angelino | | | ---- \ | | ms T-1704L | | | | \ | | | 4800 Oak Grove Drive | | | | -- | | | Pasadena, CA 91109 ---| | | | \__/ | |___ robert@triton.jpl.nasa.gov \____|et |_|ropulsion |_____\aboratory (818) 354-9574