Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, dBc), 18,430 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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