copy const c8 * to const c8*

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Lo_Ord
Posts: 12
Joined: Thu Apr 27, 2006 2:24 pm

copy const c8 * to const c8*

Post by Lo_Ord »

Hi!

I know, this is a stupid question, but I've been sitting now on this (ridiculously small) problem and don't know the answer...

Here is what i got:

Code: Select all

struct FireData
{
   //stuff 
   const c8* filename;
}

//in the main function:
{
   FireData fire = new FireData();
   //reading a xml-file
   {
      if (stringw("fire20") == mapXml->getNodeName())
      {
         fire->file = mapXml->getAttributeValue("file");
      }
   }

   //Loading a fireemitter
   //Loading the texture for the emitter:
   fire->node->setMaterialTexture(0, driver->getTexture(filename));

   //do the rest
}
The problem is: when the fireemitter is loaded and I try to load the texture, the const c8* string in fire->file is not valid anymore.

I think I know how to solve the problem: by simply using a strcpy-like funktion, which copy's from const char* to const char* :D

Is there a function or a way to do that?

TiA

Lo_Ord
Post Reply