Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Haha Console Program that Displays..., ...Variable's Locations in Memory
United States
OniLink10
Posted: Nov 20 2008, 09:58 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


This is a Test for the People of MFGG, to see how their Windows or WINE-Running OSes store Variables. This Console Program declares 5 Integers, 5 Doubles, and 5 Bools to see how different Computers store the variables. Here are my Results:
Int a: 0x22FF74
Int b: 0x22FF70
Int c: 0x22FF6C
Int d: 0x22FF68
Int e: 0x22FF64
Double f: 0x22FF58
Double g: 0x22FF50
Double h: 0x22FF48
Double i: 0x22FF40
Double j: 0x22FF38
Bool k: 0x22FF37
Bool l: 0x22FF36
Bool m: 0x22FF35
Bool n: 0x22FF34
Bool o: 0x22FF33

So right now this tells me that Ints take up 4 Bits, Doubles take up 1 Byte, and Bools take up 1 Bit. The Bools make sense, but I don't get the Int part. Ints, specifically unsigned ints, can have values up to 4294967295, which requires 4 Bytes. Also, Doubles should take up 8 Bytes according to this Tutorial. Hrm...

EDIT: Yes, I was dumb enough to forget the Download. Here it is!

This post has been edited by OniLink10 on Nov 20 2008, 10:00 PM


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
RetroXYZ
Posted: Nov 20 2008, 10:04 PM
Quote Post


Standard Member
[*][*]

Group Icon
Group: Members
Posts: 2714
Member No.: 4325
Joined: 27-August 07

Status: (0d) [--]


Thank you for stating the already there.
PMEmail PosterMSN
Top
United States
RetroXYZ
Posted: Nov 20 2008, 10:07 PM
Quote Post


Standard Member
[*][*]

Group Icon
Group: Members
Posts: 2714
Member No.: 4325
Joined: 27-August 07

Status: (0d) [--]


Oops.

This post has been edited by RetroXYZ on Nov 20 2008, 10:07 PM
PMEmail PosterMSN
Top
Austria
Guinea
Posted: Nov 21 2008, 03:43 PM
Quote Post


6
[A][*][*][*][*]
[*][*][*][*][*]
[*]

Group Icon
Group: Admins
Posts: 8600
Member No.: 893
Joined: 15-March 05

Status: (0d) [--]


Onilink, adresses are written in byte-steps already.
An integer takes four bytes, a float takes 8 and a bool apparantly takes one byte, too.


You could easily have found that same things out by using the "sizeof" operator (assuming that it exists in C++ or whatever language you used to write that. I only know that by "sizeof(insert type here)" you can get the exact number of bytes that a variable of said type takes in C.


EDIT: oh and I don't recall this being a game, so why is this here?
-moved.
PMEmail PosterAOLMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0397 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.57 ]