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 / Text input via gbGetEntry and char*

Author
Message
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 17th Jun 2008 05:48 Edited at: 17th Jun 2008 11:03
Hi,

I'm trying to develop a multiplayer RPG using Dark GDK but I'm having issues with text input. Eventually I'll want a chat system but I'll deal with that later.

For now, I'm just trying to give the player a GUI to type the IP of the computer they want to connect to. I want it to behave like a typical single-line text box, with the text appearing on screen as I enter it and backspace to remove the last inputted character.

The problems I'm having are, basically, crashes when trying to connect char* variables together.

dbGetInput() returns a char array (char*), correct?
From what I understand, strcat and strlen are designed to work on char arrays (char variable[size]). My variables have no array brackets [] because if I use them, the dbGetInput line gives me a compiler error. How am I supposed to join two char* strings together? The program crashes every time it sees a strcat or strlen in my code. I don't understand what I'm doing wrong.

Any advice is much appreciated.

Here are segments of the code I have right now:



[EDIT]
Nevermind, I found the problem!

should be:

heh d'oh
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 17th Jun 2008 07:53
Hey okay, nevermind!
I got it figured out:


Here was the problem



heh...I feel dumb.

Login to post a reply

Server time is: 2024-09-29 23:24:09
Your offset time is: 2024-09-29 23:24:09