What is the correct form of this?:
- Code: Select all
int i;
i=cloneindex-1;
block.i.type=0;
and this:
- Code: Select all
int i;
i=cloneindex-1;
if(block.i.type==0){
...
}
int i;
i=cloneindex-1;
block.i.type=0;
int i;
i=cloneindex-1;
if(block.i.type==0){
...
}
Actor tactor;//Temporary actor
int i;
char temp[256];//Temporary string holder
i=cloneindex-1;
sprintf(temp,"block.%d",i);
tactor=getclone(temp);//getclone returns a pointer to the mentioned actor.
//A pointer is a variable that points to a space in memory, in this case, tarctor will point to "block.i"
tactor->type=0;
//When dealing with pointer variables, you need to use the point-to (->) and not the .
Actor tactor;
int i;
char temp[256];
i=cloneindex-1;
sprintf(temp,"block.%d",i);
tactor=getclone(temp);
if(tactor->type==0)
{
//do something :)
}
Users browsing this forum: No registered users and 1 guest