Working with strings
Posted: Tue Jan 10, 2012 9:10 am
I have some problems working with strings. I have read the manual and I have seen that Game-Editor provides some functions to be used with strings. However, I cannot understand how to perform certain operations. In particular:
1) How to convert an integer into a string. Game-Editor provides the function for string-to-integer (atoi) but not the reverse (or at least I have not found it).
2) I have two variables declared string st1 and st2. I want to assign st2 a substring of st1 starting at position m and lenght n. From what I read substrings of controlled lenght can be copied into another string but only starting at the beginning (strncpy).
Thanks in advance.
1) How to convert an integer into a string. Game-Editor provides the function for string-to-integer (atoi) but not the reverse (or at least I have not found it).
2) I have two variables declared string st1 and st2. I want to assign st2 a substring of st1 starting at position m and lenght n. From what I read substrings of controlled lenght can be copied into another string but only starting at the beginning (strncpy).
Thanks in advance.