Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by miwok. 12/06/23 16:32
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (miwok, AndrewAMD, TipmyPip, 3run, Quad, 1 invisible), 645 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Some confusion about pointers #351922
12/29/10 16:09
12/29/10 16:09
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Hi, i am new to pointers and dealing with them..

i got the folliwing code which i cant figure out how to work right:
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <ackphysx.h>

///////////////////////////////


function Create_ent(ENTITY**ent,char*filename,VECTOR*position)
{
	ent = ent_create(filename,position,NULL);
	

}


ENTITY* box;

function main()
{
 	physX_open();
 	level_load("level.hmp");
 	Create_ent(box,"cube.mdl",vector(0,0,0));
 	box.x=90;
 	
 	
}



I get an error in main called SYS..
I want to load box with the pointer 'ent'

Last edited by peteredlin; 12/29/10 16:09.
Re: Some confusion about pointers [Re: peteredlin] #351923
12/29/10 16:25
12/29/10 16:25
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
You have to dereference your pointer: (notice the asterisk)

*ent = ent_create(filename,position,NULL);

Re: Some confusion about pointers [Re: Saturnus] #351924
12/29/10 16:30
12/29/10 16:30
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Thank you very much

I have one more question about pointers, this has to do with structs.

If i create 2 structs of the same type, and i want to use them for loading a fucntion with variables how must i write that function then? (that one and the same fucntion can work with multiple structs)

Thanks in advance.




Last edited by peteredlin; 12/29/10 17:25.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1