๐ ๊ณต๋ถํ๋ ์ง์ง์ํ์นด๋ ์ฒ์์ด์ง?
wsl bash ์ด ๋๋ง๋ค LifeGoal ๋์ฐ๊ธฐ by PICO ๋ณธ๋ฌธ
๐ฉ๐ป IoT (Embedded)/C++
wsl bash ์ด ๋๋ง๋ค LifeGoal ๋์ฐ๊ธฐ by PICO
์ง์ง์ํ์นด 2023. 12. 28. 15:16728x90
๋ฐ์ํ
๐ wsl ์ด ๋๋ง๋ค.. ์๊ทน๋๋ ๋ฌธ๊ตฌ LifeGoal! ๋์ฐ๊ธฐ
// shell์ export PICO ๋ฑ๋ก์ํค๊ธฐ!!
// ์ค์ ํ์ผ ๋งจ ๋ฐ์... ํ๋ก๊ทธ๋จ ๋ฃ์ผ๋ฉด ๋จ
vim .bashrc
// .bashrc ์ ์ถ๊ฐํ ๊ฒ
export PICO_SDK_PATH=~/pico/pico-sdk
cd (๋ด ํ ๋๋ ํฐ๋ฆฌ, or main.out ํ์ผ ์์น)
./main.out
// ๋์ LifeGoal ์ wsl ์คํ๋ง๋ค ์๊ธฐ ์ํค๊ธฐ
// shell์ export PICO ๋ฑ๋ก์ํค๊ธฐ!!
// export PICO_SDK_PATH=~/pico/pico-sdk
// vim .bashrc
// ์ค์ ํ์ผ ๋งจ ๋ฐ์... ํ๋ก๊ทธ๋จ ๋ฃ์ผ๋ฉด ๋จ
// cd (๋ด ํ ๋๋ ํฐ๋ฆฌ)
// ./main.out
#include <string>
#include <vector>
#include <iostream>
#include <vector>
#include <boost/pfr.hpp>
#include <boost/pfr/core_name.hpp>
using namespace std;
struct NextYear
{
vector<string> Personal;
vector<string> Career;
vector<string> Business;
vector<string> Economic;
vector<string> Toy;
vector<string> Adventure;
vector<string> Contrubution;
};
struct TenYear
{
vector<string> Personal;
vector<string> Career;
vector<string> Business;
vector<string> Economic;
vector<string> Toy;
vector<string> Adventure;
vector<string> Contrubution;
};
struct LifeGoal
{
struct NextYear next;
struct TenYear ten;
};
int main()
{
struct LifeGoal goal;
goal.next.Personal.push_back("IT ์ทจ์
์ค๋น ๋ฐ ํฉ๊ฒฉ");
goal.next.Career.push_back("C ๊ธฐ๋ฐ ์๋ฒ ๋๋ ๊ต์ก์");
goal.next.Business.push_back("์์ ์ ๋งค์ถ ๋ง๋ค๊ธฐ");
goal.next.Economic.push_back("์ฒญ๋
์ ์ถ ๊ฐ์
");
goal.next.Toy.push_back("์ ํ ์กฐ์ด์คํฑ ๊ฒ์๊ธฐ ์ฌ๊ธฐ");
goal.next.Adventure.push_back("์ ๊ตญ ํฌ์ดํ๊ธฐ");
goal.next.Contrubution.push_back("์ทจ์ค์๋ค์๊ฒ ๋ฉํ ๋์ด์ฃผ๊ธฐ");
goal.ten.Personal.push_back("๋ง๋ฌผ์ ์ด์ฐ๊ฒฐ์ ์ด์ฐ๋ฅด๋ ์ ๋ฌธ๊ฐ ๋๊ธฐ");
goal.ten.Career.push_back("๋ฉ์์ด ์์ฌ");
goal.ten.Business.push_back("๋ ๋์ ๋ถ์ผ ์ง์ถ");
goal.ten.Economic.push_back("์ํ ์ฌ๊ธฐ");
goal.ten.Toy.push_back("์ฆ๊ฐํ์ค (VR) ์์ ์น๊ตฌ๋ค ๋ง๋๊ธฐ");
goal.ten.Adventure.push_back("์คํ์ธ๊ฐ์ ๊ฐ์ฐ๋ ๊ฑด์ถ๋ฌผ ๋ณด๊ณ ์๊ฐ ์ป๊ธฐ");
goal.ten.Contrubution.push_back("ํด์ธ ์๋ฃ ๋ด์ฌ ๊ฐ๊ธฐ");
cout << "------------------------------LIFE GOAL------------------------------" << endl;
// LifeGoal ์ถ๋ ฅ
constexpr auto names = boost::pfr::names_as_array<LifeGoal>();
boost::pfr::for_each_field(
goal.next,
[&names](const auto &fields, std::size_t idx)
{
// cout << idx << endl;
cout << names[idx] << endl;
for (auto it = fields.begin(); it < fields.end(); ++it)
{
auto field = *it;
cout << "\t" << field << endl;
}
});
return 0;
}
728x90
๋ฐ์ํ
'๐ฉโ๐ป IoT (Embedded) > C++' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Comments