Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,796 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 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