Difference btw C++ and C with respect to variable.

I want to know what is the difference btw the variables of C++ and C?
and if possible give me a simple program to check.
What do you mean
difference btw the variables of C++ and C
exactly?

You mean about variable types? Basically C++ is (almost) a perfect superset of C so almost all your C known issues work on C++.

C++ on the other hand provide some new types. I don't refer to user-defined ones as they are infinite of course.
bool is not supported in C, you have to use int, short etc. I think it was added after as _Bool.

Anyway short, int, long, float, double all exist in both.

Also there is no std::string, vector etc. For strings in C it's always char * and char[N]

I guess others will fill this up with extra info.
Topic archived. No new replies allowed.