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
21void useExampleClass(Example &exampleObj, const std::string &newMessage) {
22 exampleObj.setMessage(newMessage);
23 std::cout << "useExampleClass: ";
24 exampleObj.printMessage();
25}
Example クラスの定義
Example クラス
Definition Example.hpp:29
void setMessage(const std::string &new_msg)
メッセージを設定します。
Definition Example.cpp:24
void printMessage() const
メッセージを出力します。
Definition Example.cpp:28
void useExampleClass(Example &exampleObj, const std::string &newMessage)
Example クラスのインスタンスを作成し、メッセージを設定して出力します。