954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

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.

AshwinCareem
Newbie Poster
1 post since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
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.

Ravalon
Posting Whiz in Training
213 posts since Dec 2006
Reputation Points: 84
Solved Threads: 15
 

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.

VatooVatoo
Light Poster
40 posts since Jan 2007
Reputation Points: 20
Solved Threads: 2
 

Write a program the outputs sizeof(<em>type)</em> to display the size of each type in bytes. Then multiply by 8 for bits.

For example sizeof(char) will probably output 1.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943
 

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

orangejuice2005
Junior Poster in Training
78 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

Link .Scroll down to Fundamental data types.

Niek

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You