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
29class 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
76void useExampleClass(Example &exampleObj, const std::string &newMessage);
77
78#endif // EXAMPLE_HPP
void useExampleClass(Example &exampleObj, const std::string &newMessage)
Example クラスのインスタンスを作成し、メッセージを設定して出力します。
Example クラス
Definition Example.hpp:29
void setMessage(const std::string &new_msg)
メッセージを設定します。
Definition Example.cpp:24
Example()
デフォルトコンストラクタ
Definition Example.cpp:20
void printMessage() const
メッセージを出力します。
Definition Example.cpp:28
std::string getMessage() const
メッセージを取得します。
Definition Example.cpp:26