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 


storing buffer in int array
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
TerryDonahugh
Master Cheater
Reputation: 0

Joined: 12 Sep 2007
Posts: 412
Location: .nl

PostPosted: Thu Oct 25, 2007 6:52 am    Post subject: Reply with quote

nog_lorp wrote:
[...]
Anyhow, in the end this is quite silly.
Code:
char chararray[4];
int intarray[4];
intarray = (int*)chararray;


Voila. Although the values in intarray are still the ascii codes rather than in the 1-26 range.
[...]


That does not work. Int elements are usually 32 bits and char elements 8 bits. Since you are reinterpret casting the pointers the value of intarray[0] holds all 4 characters of chararray (intarray[1] and upwards are out of bounds). You can regard chars as signed 8 bit numbers so this whole casting malarkey is overkill.
Back to top
View user's profile Send private message Send e-mail
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Thu Oct 25, 2007 1:56 pm    Post subject: Reply with quote

multi-brain fart on the sizeof(int) thing and the conversion functions ><.

Anywho, matrices weren't your problem because you weren't using matrices you were using multidimensional arrays. The "matrix multiplication" you were using WASN'T matrix multiplication.

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu Oct 25, 2007 1:58 pm    Post subject: Reply with quote

but its the fact that the intention was what is the equivalent of a matrix in algebra. Just because i wasn't doing it right doesn't mean it wasn't my intentions.

At any rate i finished it and its all good

Encode and Decode

_________________
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Thu Oct 25, 2007 2:16 pm    Post subject: Reply with quote

Congrats on finishing.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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