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 / fatal error on dbStr?

Author
Message
AriEf
9
Years of Service
User Offline
Joined: 30th Nov 2009
Location: Indonesia
Posted: 25th Sep 2012 17:52 Edited at: 25th Sep 2012 17:53
i always using this code and it works fine for me.



but i dont know why i got this message after i formatted my computer

Quote: "Microsoft Visual Studio C Runtime Library has detected a fatal error in CongklakTheGame.exe"


i've tried to change the code to be like this

and it works fine. So the Problem maybe the dbStr...
Help anyone?

Rank : Beginner Coder
Im Indonesian, and I cant speak english, i hope you understand
Gunslinger
11
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 25th Sep 2012 18:54 Edited at: 25th Sep 2012 18:54
Try
AriEf
9
Years of Service
User Offline
Joined: 30th Nov 2009
Location: Indonesia
Posted: 26th Sep 2012 05:35
Ok, Thanks, but there is still 2 question which i like to ask.

1. Why the fatal error occured when i use my last code? I was always using that code and never fail before until now.

2. I'm using this code right now :

but the Output is "In the Hand : -1#QNUON". Why is like that?
P.S : I'm not sure with #QNUON, but it something like that.

Rank : Beginner Coder
Im Indonesian, and I cant speak english, i hope you understand
Gunslinger
11
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 26th Sep 2012 12:37 Edited at: 26th Sep 2012 14:54
Is p1tangan a float variable?

dbStr: Is slot1 an integer?

try
char test[255];
dbStr(test, slot1);
dbText(..., test);

e/ No clue, dbStr is working correct for me.
JTK
9
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 26th Sep 2012 17:20
It sounds to me like you're trying to test it in RELEASE mode. Is that correct?

As a general rule, you should initialize all variables to some DEFAULT value whether you expect it to stay that way or not... In DEBUG build, the CRT library does this for you but in RELEASE build nothing gets done - you have to do it.

If the variable has not been initialized by the time dbStr() or whatever needs to use it, then the results are "undetermined" which generally means Crash!

So be sure to add following code before you need to use the values:


Hope this helps,
JTK

Login to post a reply

Server time is: 2019-05-20 18:30:27
Your offset time is: 2019-05-20 18:30:27