Difference between a type and a class?

A

ambar.shome

Hi all,

I have a very basic fundamental wuestion to ask. I am confused about
the difference between type and class? is "int","float","double" a
type? With so many C++ gurus out here, I dont know whether should I
ask this question here or not? But if anyone can help me out, I'll feel
good.
 
D

David White

Hi all,

I have a very basic fundamental wuestion to ask. I am confused about
the difference between type and class? is "int","float","double" a
type?

Yes, these are built-in types, but they are not classes.

A class is also a type, but a type isn't necessarily a class.
With so many C++ gurus out here, I dont know whether should I
ask this question here or not?

It's a completely valid question here.
But if anyone can help me out, I'll
feel good.

Good.

DW
 
R

Ron Natalie

EventHelix.com said:
Classes are nothing but structures associated with some methods.

Nope, classes are just structs with a different default access level.
In truth, structs are classes as far as format C++ terms go. Either
one can have methods, neither is required to have (user-declared)
methods.


The
The article seems to have NOTHING to do with the topic.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top