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.

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.

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.

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

For example sizeof(char) will probably output 1.

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

Link .Scroll down to Fundamental data types.

Niek

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.