Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


A little doubt about structs with pointers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Kyl3
How do I cheat?
Reputation: 0

Joined: 01 Jun 2013
Posts: 1
Location: Brazil

PostPosted: Sat Jun 01, 2013 2:19 pm    Post subject: A little doubt about structs with pointers Reply with quote

Hey,

I have the pointer to the structure of the player, and tested to access the values ​​I wanted, but I got a problem (in fact I'm not sure if it really is one), which consists of the following: I have, for example, the first element in this structure the player's health, the second to the eleventh unknown values​​, and on the twelfth I have the ammo player's primary weapon.

My question is: I really need to add "char unknown" until the twelfth, or have some way to "pass" it? Drawing what I said:

Code:

// Is possible to do this? If yes, how?
typedef struct {
   int HP; // first element
        // second to eleventh are ignored in the struct
   int SecAmmo; // twelfth
} Player_Base;


How I'm having to use (not very good):

Code:

typedef struct {
   int HP;
        char unk2[128]; char unk3[128]; char unk4[128]; char unk5[128]; char unk6[128]; char unk7[128]; char unk8[128]; char unk9[128]; char unk10[128]; char unk11[128];
   int SecAmmo; // 12
} Player_Base;


Thanks in advance. Confused
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25824
Location: The netherlands

PostPosted: Sat Jun 01, 2013 3:04 pm    Post subject: Reply with quote

What prohibits you from doing a char unk[128*10]; ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites