Hey ratchet,

even though the problem is solved, I hope you don't mind me adding a sentence or two here?

You may think that it's not as "easy and trivial", and I agree it's confusing at first. But it makes a lot of sense, and this here is a great chance to learn something important.

You have to understand that if you write this:

Code:
STRING* listeTiles [20] ;



You're creating pointers, and *NOT* strings itself. That is to say, the engine will give you twenty pointers that currently point to nothing in particular. And since they don't point to anything, and there's no actual string behind it, something like

str_cpy(listeTiles[0],"Hello?");

will crash.


So why does something like that work, then?

Code:
STRING* mystring = "Hello.";

...

function something(..) {
..
str_cpy(mystring,"Dude!");
}



Good question. The reason is that because you assigned "Hello" to it, lite-c reads this differently, and automatically creates a string for you (with the Text "Hello" in this case), and then points the pointer mystring to it. Since mystring is then no longer empty, and points to something, the str_cpy-stuff works.

In your case, since you're creating several pointers at once, you have to create the actual strings yourself (and make sure the pointers point to that). You create those using str_create, which is why it worked with that afterwards.



A while ago, I wrote a medium-length post that goes into that, so if you're still having questions or if you're still curious, maybe go check it out?


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!