CPP0X_Base
1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Example.hpp
[詳解]
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* Example.hpp :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/04/26 16:31:51 by kamitsui #+# #+# */
9
/* Updated: 2025/05/01 23:52:23 by kamitsui ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
19
#ifndef EXAMPLE_HPP
20
#define EXAMPLE_HPP
21
22
#include <
string
>
23
29
class
Example
{
30
private
:
31
std::string
message;
32
33
public
:
39
Example
();
40
48
Example
(
const
std::string
&msg);
49
55
void
setMessage
(
const
std::string
&new_msg);
56
62
std::string
getMessage
()
const
;
63
67
void
printMessage
()
const
;
68
};
69
76
void
useExampleClass
(
Example
&exampleObj,
const
std::string
&newMessage);
77
78
#endif
// EXAMPLE_HPP
useExampleClass
void useExampleClass(Example &exampleObj, const std::string &newMessage)
Example クラスのインスタンスを作成し、メッセージを設定して出力します。
Definition
useExampleClass.cpp:21
std::string
Example
Example クラス
Definition
Example.hpp:29
Example::setMessage
void setMessage(const std::string &new_msg)
メッセージを設定します。
Definition
Example.cpp:24
Example::Example
Example()
デフォルトコンストラクタ
Definition
Example.cpp:20
Example::printMessage
void printMessage() const
メッセージを出力します。
Definition
Example.cpp:28
Example::getMessage
std::string getMessage() const
メッセージを取得します。
Definition
Example.cpp:26
string
ex0X
Example.hpp
構築:
1.9.8