Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Open Reality / int to FBstring convertion trouble
  RSS 2.0 ATOM  

int to FBstring convertion trouble
Rate this thread
 
17786
 
Permlink of this thread  
avatar
  • zozizozu
  • Posted: 13 October 2008 05:39 AM
  • Total Posts: 9
  • Joined: 08 October 2008 03:47 PM

Hi,
I’m trying to make a device and i have trouble to put the number of channel into its name (Chnl_1, Chnl_2, ...).

I’ve tried this

for( int  i 0mChannelCounti++ )
    
{
        char intochar


        
//_itoa_s(i,&intochar,40,10);
        
sprintf(&intochar"%d");

        
FBString tmpChnlName("Chnl_",&intochar );
        
mChannelName[i] tmpChnlName;
    
}

but, both itoa and sprintf return a string like : Chnl_0_ strange squarre sign =3 strange squarre sign .....

I’m really newbee in c++, so please , be indulgent .

Thanks



3o3i

Replies: 0
avatar
  • zozizozu
  • Posted: 14 October 2008 03:41 AM

Hi, answering to myself may help .....

The char intochar can store only 1 char, and we need 3 to have 100 sensors, so :

for( int  i 0mChannelCounti++ )
    
{
        char intochar[3]

        
_itoa_s(i,intochar,40,10); 

        
FBString tmpChnlName"Chnl_",intochar );
        
mChannelName[i] tmpChnlName;
    
}

Thanks for helping

regards

3o3i



3o3i

Replies: 0