Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Multisync and entering ip

Author
Message
Superdeath360
13
Years of Service
User Offline
Joined: 23rd Nov 2010
Location:
Posted: 16th Jun 2011 06:30
So, multisync requires there to be an ip to connect to declared like

I'm trying to make it so the user can input the ip to connect to, but dbGetEntry() only accepts char*. So what I'm asking...is like there a way to convert between the two? Or some other solultion...really bothering me

herp derp
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 16th Jun 2011 22:22
A simple strcpy or strncpy command will transfer text from char* to char array. The second command limits the number of characters to copy, to prevent overwriting the array.

http://www.cplusplus.com/reference/clibrary/cstring/strcpy/
http://www.cplusplus.com/reference/clibrary/cstring/strncpy/

However, I can also offer you a complete input function which I wrote some time ago in another thread. You can call this function every loop until you detect a return key and it will store the typed input into a char array. Here it is, if you are interested.

http://forum.thegamecreators.com/?m=forum_view&t=160546&b=22&msg=1898323#m1898323
Superdeath360
13
Years of Service
User Offline
Joined: 23rd Nov 2010
Location:
Posted: 18th Jun 2011 07:15
Thanks! strncpy works..I used strcpy before, I think and got an error. Your function is extremely useful too! I think I'll make sure I understand every part of it before I use it.

herp derp

Login to post a reply

Server time is: 2024-11-19 10:39:20
Your offset time is: 2024-11-19 10:39:20