Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the term "method" defined by the C++ Standard?

The term "method" is often used to discuss C++ code. Does the standalone term have a well-defined meaning in C++ or is it ambiguous? Is it acceptable to use the term by itself, or should it be qualified (e.g. a "class method" or "virtual method"), or should it be simply avoided altogether?

like image 282
Barry Avatar asked Apr 18 '15 17:04

Barry


People also ask

What is method definition in C?

Function / Method: is a group of statements that together perform certain task. Note: Every C program should have 1 main function. No 2 functions / methods should be named as main. Video Tutorial: Function / Methods In C Programming Language.

What are the C standards?

C standard may refer to: ANSI C, C99, C11, C17, or C2x, specifications of the C programming language. C standard library. C tuning (guitar), a type of tuning for guitars.

How methods are defined in a class?

A method is an executable element defined by a class. InterSystems IRIS supports two types of methods: instance methods and class methods. An instance method is invoked from a specific instance of a class and typically performs some action related to that instance.

What is method and function in C?

Function or a method is a named callable piece of code which performs some operations and optionally returns a value. In C language the term function is used. Java & C# people would say it a method (and a function in this case is defined within a class/object).


1 Answers

The term method is not defined in the C++ standard. The terminology uses member function instead.

Bjarne Stroustrup however defines the term method in his own glossary as virtual member function. So this shows evidence that the term is acceptable.

like image 149
Christophe Avatar answered Sep 21 '22 16:09

Christophe