Source |
CodingSec |
Identifiant |
188071 |
Date de publication |
2016-10-10 17:00:00 (vue: 2016-10-10 17:00:00) |
Titre |
what are constant parameter member functions |
Texte |
Constant Member Functions Member functions in a class can be declared as constant if that member function has no necessity of modifying any data members. A member function can be declared as constant as follows: 1 2 3 4 return–type function–name(params–list) const { //body of function } Following program demonstrates the use of constant member functions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include<iostream> using namespace std; class
|
Envoyé |
Oui |
Condensat |
#include<iostream> //body any appeared are can class coding const constant data declared demonstrates first following follows: function function–name functions functions: has member members modifying namespace necessity parameter params–list post program return–type security std; use using what |
Tags |
|
Stories |
|
Notes |
|
Move |
|