Originally Posted By: Dark_samurai
Yep, that was the problem. Thanks!

DLLFUNC void string_test()
{
char buffer[50];
short reseiver;

sprintf_s(buffer,50,"%d",10);
sscanf_s(buffer,"%d",&reseiver);
}

But if I use this function in GS i get this runtime error:
Debug Error!

Run-Time Check Failure #2 - Stack around the variable 'reseiver' was corrupted.

What am I doing wrong?


Dark_Samurai


Probably because the function is expecting a double which is 4bytes and you gave it a short which is 1-2bytes depending on compiler/Os.

Stick with ints/floats, they're faster in almost all cases. 2Byte data types don't help unless you're using them inside classes to save space. Things are optimized more efficiently if all the data you're using is 32bits for the most part.

Can I recommend you try out the STD::STRING stuff? char*'s and the stdlib cstring manipulators are very very dangerous, I can't tell you how many times I've blown up the heap/stack with them \:D .


"Towlie, you're the worst character ever." I know...