Solved

Memory Question?

Posted on 1998-09-12
1
235 Views
Last Modified: 2010-05-18
Hi. I have two questions, really.
First of all: When I use sizeof, of elementary types, such as sizeof(short) : Is it done on-line or is the size calculated at compile time?
Second : Is it really useful to use short/char and such type to save space, or is everything 32 bit under windows95?
thanks!

   Ron (Who is using VC++ for this, under win95)
0
Comment
Question by:ShadowHawk071998
1 Comment
 
LVL 5

Accepted Solution

by:
yonat earned 50 total points
ID: 1172582
1. The calculation is done at compile time.
2. Usually not. The compiler may pad it to 32 bit anyway, and if doesn't there may be a performence penalty.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question