C++: problam with data type(int,float,double)

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2007
Posts: 1
Reputation: AshwinCareem is an unknown quantity at this point 
Solved Threads: 0
AshwinCareem AshwinCareem is offline Offline
Newbie Poster

C++: problam with data type(int,float,double)

 
0
  #1
Jan 26th, 2007
Hi everyone, I have a problam with data types which are using in C++. I am so confuce about int,float,double,strings,etc; And numbers of bits that related to each data type. Please anyone help me to solve my problam.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 209
Reputation: Ravalon is on a distinguished road 
Solved Threads: 15
Ravalon's Avatar
Ravalon Ravalon is offline Offline
Posting Whiz in Training

Re: C++: problam with data type(int,float,double)

 
0
  #2
Jan 26th, 2007
Originally Posted by AshwinCareem View Post
Hi everyone, I have a problam with data types which are using in C++. I am so confuce about int,float,double,strings,etc; And numbers of bits that related to each data type. Please anyone help me to solve my problam.
The number of bits depend on the compiler. I'm sorry, but I really can't give a better answer without a more detailed question.
It's hard to be humble when you're as gifted as I am at pretending to be an expert.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 32
Reputation: VatooVatoo is an unknown quantity at this point 
Solved Threads: 2
VatooVatoo's Avatar
VatooVatoo VatooVatoo is offline Offline
Light Poster

Re: C++: problam with data type(int,float,double)

 
0
  #3
Jan 29th, 2007
if we suppose you are using VC++ 7.0 or 8.0, ints and floats are often 32-bit, chars 8-bit, and doubles are usually 64-bit.

strings is not a base type.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: C++: problam with data type(int,float,double)

 
0
  #4
Jan 29th, 2007
Write a program the outputs sizeof(type) to display the size of each type in bytes. Then multiply by 8 for bits.

For example sizeof(char) will probably output 1.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 79
Reputation: orangejuice2005 is an unknown quantity at this point 
Solved Threads: 0
orangejuice2005 orangejuice2005 is offline Offline
Junior Poster in Training

Re: C++: problam with data type(int,float,double)

 
0
  #5
Jan 29th, 2008
Am very new to programming but what are these data types associated with, like

chars = letters such as a, b, c
strings = words such as boy, cat, jill
int = numbers such as 1 , 2, 3
double =?? does a double mean decimal numbers?
float = ?? does this mean larger decimal numbers?

srry am very new to this myself
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,826
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 297
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: C++: problam with data type(int,float,double)

 
0
  #6
Jan 30th, 2008
Link .Scroll down to Fundamental data types.

Niek
Last edited by niek_e; Jan 30th, 2008 at 4:30 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC