[vtkusers] writing integer variable on screen
    Kernel Blaha 
    kernelblaha at gmail.com
       
    Tue Aug 25 05:04:58 EDT 2009
    
    
  
You need to convert your variable to a string of characters.
Something like this:
char string[50];
.
.
.
sprintf(string,"%d",variable);
vecText->SetText(string);
> hi everyone!
> I wan to write somenthing on screen I use this c++ codes.here is  
> begining:
>
> vtkVectorText* vecText = vtkVectorText::New();
>     vecText->SetText("vtkVectorText");
>
> I send input like "vtkvectortext" than it is work. but I want to write  
> 1, 2,
> 3, like something integer.
>
> if I write my variable directly  ;i.e    vecText->SetText(variable);
>
> I get error like :
> Error    2    error C2664: 'vtkVectorText::SetText' : cannot convert
> parameter "variable_value" from 'int' to 'const char *'
>
> so How do I  write my integer variable!!!
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
    
    
More information about the vtkusers
mailing list