Re: [info-performer] C/C++ typecast problem

Date view Thread view Subject view Author view

From: Manuel Pabst (manuel.pabst++at++gmx.de)
Date: 02/17/2004 14:41:46


Hi faculaganymede,

try:
char **temp[2];
fun ((const char *(*)[2]) temp);

My Intel 7.0and VisualStudio 6.0 compilers seemed to like it...

Manuel

--
Manuel Pabst
Fischerweg 10
D-83024 Rosenheim
+49 8031/8 51 52
+49 172  /84 64 94 0

----- Original Message ----- From: "faculaganymede" <faculaganymede++at++yahoo.com> To: "SGI Performer MailList" <info-performer++at++sgi.com> Sent: Tuesday, February 17, 2004 10:34 PM Subject: [info-performer] C/C++ typecast problem

> I have a C/C++ programming question. It is not > exactly related to Performer, but I know you are all > experts in the area, so hopefully someone can help me > out. > > I have to use an API function with the following > prototype: > > void fun(const char *fnames[][2]); > > //fnames is supposed to be a 3D array (can be thought > of as two arrays of pointers with each pointer > pointing to a string of characters). > //For example, fnames can be used to store the names > of students in two workshops. The number of students > in the two //workshops may or may not be the same. > The names of the students can be of length 256 > characters. > > How can I setup the argument variable (fnames) to use > fun()? > > Here is what I've tried but didn't work: > ---------------------------------------- > I allocated a variable of the following type and gave > it some values: > char **temp[2]; > > Then, I called the function as follows, but I couldn't > seem to get it to work: > fun(temp); //doesn't work, typecast error > fun((const char **[2])temp); //doesn't work, typecast > error > fun((const char ***)temp); //doesn't work, typecast error > > ===== > Thanks, > faculaganymede > > __________________________________ > Do you Yahoo!? > Yahoo! Finance: Get your refund fast by filing online. > http://taxes.yahoo.com/filing.html > > ----------------------------------------------------------------------- > List Archives, Info, FAQ: http://www.sgi.com/software/performer/ > Open Development Project: http://oss.sgi.com/projects/performer/ > Submissions: info-performer++at++sgi.com > Admin. requests: info-performer-request++at++sgi.com > ----------------------------------------------------------------------- >


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Feb 17 2004 - 14:39:19 PST