Page 1 of 1

Byte Sizer Application

Posted: Fri Sep 10, 2004 8:19 am
by Excal
Well, I got bored last nite and built a Byte Sizer. The download link is below. Unfortunately, there's no schnazzy GUI (Graphical User Interface) so it has to run in DOS. To get to DOS, simply go to Start > Run. Then type in CMD. A Command Prompt (DOS) box will appear. Just navigate to the directory you extracted the Byte Sizer to by typing the following command:

cd <Byte Sizer Directory>

It should take you to the folder that the Byte Sizer is in. Now type in byte_sizer.exe in the DOS box and the program will execute. Now to explain what this does;

On various computer's variables types in C++ can have different sizes. This can help with setting aside memory for a variable in order for an application to run. With this application (coded in C++) is the source code. It's very simple and consice but it gets the job done, lol. When byte_sizer.exe is executed, it displays a list or variable types and then their size on your computer. This is mainly for people who are new to C++ and need some help with their program. You can also take a look at the source code to get some insight on how I made it. Here's the Download Link;

WinZip
http://www.halomods.com/gta-halo/files/byte_sizer.zip

WinRAR
http://www.halomods.com/gta-halo/files/byte_sizer.rar

Uncompressed (Raw EXE)
http://www.halomods.com/gta-halo/files/byte_sizer.exe

Included in the WinZIP and WinRAR archives is a ReadMe and the source code. Have fun and good luck with your programs! Feedback would be great.

-Excalibur

Posted: Mon Sep 13, 2004 10:34 am
by kaptainkommie
Why do you need to use this program to help you decide how much space to allocate? You can dynamically allocate the correct amount of memory whenever you need to just by specifying the datatype, for example to make an UINT (unsigned integer) array with 5 elements:

UINT *pArray = new UINT[5];

then to set this memory all to 0:

ZeroMemory(pArray, sizeof(UINT)*5);

sizeof() obviously returns the sizeof the datatype, class, or structure that is passed to it as its parameter.