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.

DLL Talk / pb=>c++

Author
Message
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 11th Dec 2005 06:34
does anybody know the c++ equivalent of purebasic's poke string? i want to make a plugin for 3dws but it seems to crash whenever i startup with this plugin.
this is my code using dev c+++


OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 12th Dec 2005 11:30
You can either make a generic template to take any type, or for more specific work, you would create a pointer and store something using that, eg :

char *ptr;

ptr=(char *) malloc(1024);

*(ptr)=12;

That would store 12 in the first allocated bit of memory as held by ptr

You could also use strcpy, memcpy, strncpy etc etc for storing strings.

re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 12th Dec 2005 15:17
ok thanks. wait , am i using memcpy wrong?

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 12th Dec 2005 15:20
You could run into memory problems with how your using it in 2 functions.

re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 12th Dec 2005 16:20
gotcha. thanks for the quick response

Login to post a reply

Server time is: 2024-11-21 18:33:36
Your offset time is: 2024-11-21 18:33:36