ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm currently having a similar problem. If you want to split your string up you have to memcpy (string.h) this string to a character array first, that is of course if this string is initialized by a pointer (as char *pointertostring).
An example. You have the array char txt and the string char *original_text, which is equal to "Hello". If you memcpy(&txt, original_text, 7); then "H" would be txtm "e" txt and so on. Keep in mind that each string is terminated by a null character ("\0"), so you have to copy to more elements than your string is long...
Once you've done this you can analyze your string piece by ptece or rather element by element.
However, and this is where I am stuck at... , most functions expect the "char *pointertostring", thus a constant, as an argument.
Let's say that I have the values "192.168.0.1" stored in an array and need to make a constatant out of it to send it to inet_ntoa. Does anybody know how I can do this (parse it perhaps..didn't work though)?
Lua scripting is used in custom WoW interfaces, and many other things. I didn't realize before WoW, but it is actually used in quite a number of applications, and they have a C library that lets you add lua scripting functionality to your own applications.
I've just started looking at it a bit myself, but you might want to take a look at the string handling functions of Lua 5.0 here. (the version used by WoW, if that is what you are using Lua for)
Sorry but this is not a homework my friend is running a server, and he asked me if there was a command in the server which list's all registered users (since there are both unregistered and registered)
But since there aren't any, i told him i would create a script that does the trick
the Server supports Lua so i decided to give it a chance
thanks for the help man, i am now trying to see if my modification on that link you gave me will work
Let's revert to C++ . Since my question is similar, though apparently in a different language, I will not start a seperate thread but simply refrase my prior question:
I have a character array (constant), which needs to be casted into whatever char *pointerToString represents. Usually this would be the address of the first item of a character array named pointerToString.
The problem is that no function (particullarly inet_ntoa) accepts a character array, even if I present it with a pointer to the first item. So, how do I get arround this problem?