473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

what will be the size of the class & Object ?

Hi All,
I know I am asking a dumb question but can you Please let me know
what should be the size of the class & its object? will the Objects
size will be different?

class Product
{
string m_sItem;
string m_sIteFile;
char m_oName[128]
map<string, stringm_oSubItem;
map<string, stringm_oLocalItem;
};

Product oProduct;
sizeof(oProduct)==sizeof(Product) ?? is this will be true?
If I calculate sizeof(Product) will this give me different anwser on
different system?
Thanks
Anup
Dec 26 '07 #1
3 1213
On Dec 26, 9:00 pm, Matrixinline <anup.kata...@gmail.comwrote:
Hi All,
I know I am asking a dumb question but can you Please let me know
what should be the size of the class & its object? will the Objects
size will be different?

class Product
{
string m_sItem;
string m_sIteFile;
char m_oName[128]
map<string, stringm_oSubItem;
map<string, stringm_oLocalItem;

};

Product oProduct;

sizeof(oProduct)==sizeof(Product) ?? is this will be true?
yes.
If I calculate sizeof(Product) will this give me different anwser on
different system?
maybe.
>
Thanks
Anup
Dec 26 '07 #2
On 2007-12-26 14:00, Matrixinline wrote:
Hi All,
I know I am asking a dumb question but can you Please let me know
what should be the size of the class & its object? will the Objects
size will be different?

class Product
{
string m_sItem;
string m_sIteFile;
char m_oName[128]
map<string, stringm_oSubItem;
map<string, stringm_oLocalItem;
};

Product oProduct;
sizeof(oProduct)==sizeof(Product) ?? is this will be true?
Yes.
If I calculate sizeof(Product) will this give me different anwser on
different system?
Actually, you do not have to use a different system, just changing some
compiler options might suffice.

--
Erik Wikström
Dec 26 '07 #3
>
class Product
{
string m_sItem;
string m_sIteFile;
char m_oName[128]
// ; missing, compilation error
map<string, stringm_oSubItem;
and what is this type?
map<string, stringm_oLocalItem;

};
Dec 26 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
24
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been...
26
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using...
2
by: Jim in Arizona | last post by:
Being new, i experiment a lot and usually get results I'm not hoping for. My current problem is reading from a SQL 2000 table and populating an ASP dropdownlist with a column from the table. The...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
4
by: grizggg | last post by:
I have searched and not found an answer to this question. I ran upon the following statement in a *.cpp file in a member function: static const char * const pacz_HTMLContentTypeHeader =...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.