473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

method & function

Hi,

What's the difference between method & funciton in class concept in
C++?

Thanks in advance,
Michael

Aug 3 '06 #1
9 7859
Michael schrieb:
Hi,

What's the difference between method & funciton in class concept in
C++?
There are no methods in C++. There are only functions. What do you mean?

--
Thomas
Aug 3 '06 #2
Co-ask, and what is the difference between 'variable' and 'attribute'?
I just saw these two in one article (global variable, static
attribute). Thanks.

Michael wrote:
Hi,

What's the difference between method & funciton in class concept in
C++?

Thanks in advance,
Michael
Aug 3 '06 #3
Michael wrote:
What's the difference between method & funciton in class concept in
C++?
There is a *method* to this madness...

Generally, a class contains member *functions* along with data members.
Data members represent objects in memory, member *functions* provide
the object's (class') behaviour.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 3 '06 #4
Daniel Smith wrote:
Co-ask, and what is the difference between 'variable' and 'attribute'?
I just saw these two in one article (global variable, static
attribute). Thanks.
Please do not top-post.

'Variable' is not a C++ term. It's a generic programming term and it
designates an object that can change its value during the execution
of the program. For example, a reference is not really a variable,
since it cannot change what it refers to, once initialised.

"Attribute"? I am not sure I've heard it in any C++ context. It could
be a synonym for "trait", and there are "type traits" in C++...
Michael wrote:
>Hi,

What's the difference between method & funciton in class concept in
C++?

Thanks in advance,
Michael
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 3 '06 #5
In article <11*********************@b28g2000cwb.googlegroups. com>,
"Michael" <mi*******@gmail.comwrote:
Hi,

What's the difference between method & funciton in class concept in
C++?
"Method" is not used in C++. We use the term "member-function".
Aug 3 '06 #6
Michael wrote:
Hi,

What's the difference between method & funciton in class concept in
C++?

Thanks in advance,
Michael
None in my opinion, but some people reserve the term "method" to refer
specifically to virtual functions (but this is OO lingo, not C++
terminology).
Aug 3 '06 #7
Michael wrote:
What's the difference between method & funciton in class concept in
C++?
All named blocks of code - named with a linkable entry point like foo() -
are either functions, constructors, or destructors. (The Standard sez
constructors and destructors are not functions. They are blocks of code that
bind to object lifespans.)

A function inside a class is a member function.

When using OO design, we send "messages" to objects, and they respond with
"methods". These words are jargon and have no fixed meaning. Roughly, the
message is often the name of a member function, as invoked, such as
anObject.foo(). Then the method is the contents of Object::foo().

And sometimes we say "method" to mean a virtual member function. Yet again
nothing defines these words but their contexts.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 3 '06 #8
Daniel T. wrote:
"Method" is not used in C++. We use the term "member-function".
Do as he say, not as he do. ;-)

http://groups.google.com/groups?q=%2...method+c%2B%2B

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 3 '06 #9
"Michael" writes:
What's the difference between method & funciton in class concept in
C++?
Method is Smalltalk speak for what C++ calls a member function. I prefer
the Smalltalk terminology, why use a two word phrase when there is a
perfectly adequate *word*?.
Aug 3 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Billy Boone | last post by:
I have a current web application that utilizes a login to authenticate users into the application. Once I authenticate them, I store away the user's name in a Session variable. I then utilize...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
2
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
27
by: Daniel Vallstrom | last post by:
I'm having problems with inconsistent floating point behavior resulting in e.g. assert( x > 0.0 && putchar('\n') && x == 0.0 ); holding. (Actually, my problem is the dual one where I get...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
2
by: FP | last post by:
I have a javascript variable set to the contents of a database comments field. To set the js variable I used the PHP addslashes function which encodes the apostrophe, double quotes and the...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
2
by: bips2008 | last post by:
The code seems to work fine in other browser but in IE it throws this error. This is very urgent for me and any help would be greatly appreciated For your convienence i have posted the code for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.