How can I create an XlfOper with a multi dimensional array ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I create an XlfOper with a multi dimensional array ?

Adjriou Belak
Hi,
 
 I try to display in Excel this arrays :
 
  std::vector<double> df = market.discountFactors();
  std::vector<double> zc = market.zeroCoupons();
  std::vector<Date> dt = market.maturities();
 
  char * *dfs  =new char*[df.size()];
  char * *zcs =new char*[zc.size()];
  char * *dts =new char*[dt.size()];

  for(int i=0; i< df.size();i++)
   printf(dfs[i],"%c",df[i]);
  
  for(int j=0; j< zc.size();j++)
   printf(zcs[j],"%c",zc[j]);  
 
  for(int k=0; k< dt.size();k++)
   itoa(dt[k].serialNumber(),dts[k],10);  
 
  char ** results[3];
  results[0] = dts;
  results[1] = dfs;
  results[2] = zcs;
    
  return XlfOper(df.size(),3,results);
 
And I've got this message :
warning C4800: 'char ** ' : forcing value to bool 'true' or 'false' (performance warning)
        c:\adjriou\xlw\xlw\xlfoper.h(79) : see reference to function template instantiation 'class XlfOper &__thiscall XlfOper::Set(unsigned short,unsigned char,char ***  )' being compiled

And when I run excel, I have TRUE, TRUE .... ?
 
How can I create an XlfOper with a multi dimensional array ?
 
Thanks a lot for your help.
 
Regards.

    


Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail
Reply | Threaded
Open this post in threaded view
|

Re: How can I create an XlfOper with a multi dimensional array ?

Luigi Ballabio
On 02/21/05 15:35:48, Adjriou Belak wrote:
>
>   char * *dfs  =new char*[df.size()];
>   char * *zcs =new char*[zc.size()];
>   char * *dts =new char*[dt.size()];
>
>   for(int i=0; i< df.size();i++)
>    printf(dfs[i],"%c",df[i]);

I don't know the Excel API, but you probably want to use sprintf in the  
above loop...

Later,
        Luigi

----------------------------------------

Don't say "yes" until I finish talking.
-- Darryl F. Zanuck