CPP0X_Base
1.0
読み取り中…
検索中…
一致する文字列を見つけられません
useExampleClass.cpp
[詳解]
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* useExampleClass.cpp :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/04/26 16:45:00 by kamitsui #+# #+# */
9
/* Updated: 2025/05/01 23:51:32 by kamitsui ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
17
#include "
Example.hpp
"
18
#include <
iostream
>
19
#include <
string
>
20
21
void
useExampleClass
(
Example
&exampleObj,
const
std::string
&newMessage) {
22
exampleObj.
setMessage
(newMessage);
23
std::cout
<<
"useExampleClass: "
;
24
exampleObj.
printMessage
();
25
}
Example.hpp
Example クラスの定義
std::string
Example
Example クラス
Definition
Example.hpp:29
Example::setMessage
void setMessage(const std::string &new_msg)
メッセージを設定します。
Definition
Example.cpp:24
Example::printMessage
void printMessage() const
メッセージを出力します。
Definition
Example.cpp:28
std::cout
iostream
string
useExampleClass
void useExampleClass(Example &exampleObj, const std::string &newMessage)
Example クラスのインスタンスを作成し、メッセージを設定して出力します。
Definition
useExampleClass.cpp:21
ex0X
useExampleClass.cpp
構築:
1.9.8