Solved

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

Posted on 2002-07-23
3
245 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 50 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

738 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