473,466 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

method & function

Hi,

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

Thanks in advance,
Michael

Aug 3 '06 #1
9 7860
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.