Solved

Memory Question?

Posted on 1998-09-12
1
226 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now