By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,412 Members | 917 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,412 IT Pros & Developers. It's quick & easy.

Is Class a Variable?

P: n/a
Is class a variable? Can a variable consist of variables?

For example, a vector is a class, so is this vector a variable when it
includes two int variables:

vector < int > exampleVector( 2, 2 );
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <77**************************@posting.google.com >,
Penna Elabi <te*********@go.com> wrote:
Is class a variable? Can a variable consist of variables?

For example, a vector is a class, so is this vector a variable when it
includes two int variables:

vector < int > exampleVector( 2, 2 );


"vector<int>" is not a variable, any more than "int" is; it is the name of
a specific *type* of variable. "exampleVector" is a variable which
contains two variables that don't have names of their own.

Some programmers say "class" when they really mean "object (or variable)
of that class (type)", which can be confusing.

--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.