?
Solved

What do you call a member which is not a function?

Posted on 2002-07-23
3
Medium Priority
?
255 Views
Last Modified: 2010-04-01
class A {
     getX() { return X_; }     // This is a member function
     int X_;                   // What is this ?
}


I would tend to refer to X_ as a member variable of class A, just as I would refer to getX() as a member function.  But, I don't see that term used much and I wonder if a better term exists.  

Thanks,
  Ken
0
Comment
Question by:klopter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 7171855
>> would tend to refer to X_ as a member variable of class
>>A, just as I would refer to getX() as a member function

That's exactly the terminology that is used. "Member variable" and "member function" are the correct terms, the latter can also be called a "method".
0
 
LVL 2

Expert Comment

by:jonnin
ID: 7171893
sometimes its called a data member in books etc...
0
 

Author Comment

by:klopter
ID: 7171936
Thanks

PS to jonin.  Your answer was helpful also.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question