π 곡λΆνλ μ§μ§μνμΉ΄λ μ²μμ΄μ§?
[Embedded μν νλ°μ§ λλ°μ§πΎ] μ°μ°μ & μ μΈκ³Ό μ μμ λΆλ¦¬ & ν€λνμΌ μ¬μ©νκΈ° λ³Έλ¬Έ
π©π» IoT (Embedded)/C++
[Embedded μν νλ°μ§ λλ°μ§πΎ] μ°μ°μ & μ μΈκ³Ό μ μμ λΆλ¦¬ & ν€λνμΌ μ¬μ©νκΈ°
μ§μ§μνμΉ΄ 2023. 6. 25. 23:19728x90
λ°μν
<λ³Έ λΈλ‘κ·Έλ λ°λ°°μ¨ λμ μ νλΈλ₯Ό μ°Έκ³ ν΄μ 곡λΆνλ©° μμ±νμμ΅λλ€ :-)>
=> [λ°λ°°μ¨++] λ°λΌνλ©° λ°°μ°λ C++ | λͺ¨λ c++, c++ κ°μ, c++ κ°μ’, c++ μΈμ΄, κΈ°μ΄ & c++ νλ‘κ·Έλλ°, μ½λ©
𫧠μ°μ°μ
operand : νΌμ°μ°μ (x, 2)
assignment : λμ
μ°μ°μ (=)
#include <iostream>
using namespace std;
int main() {
int x = 2; // x is a variable, 2 is a literal
cout << x + 2 << endl;
cout << "gani" << endl;
}
𫧠μ μΈκ³Ό μ μμ λΆλ¦¬
#include <iostream>
using namespace std;
int add(int a, int b); // forward declaration
int subtract(int a, int b); // forward declaration
int main()
{
cout << add(3, 4) << endl;
cout << subtract(2, 3) << endl;
return 0;
}
// definition
int add(int a, int b)
{
return a + b;
}
int subtract(int a, int b)
{
return a - b;
}
𫧠ν€λνμΌ μ¬μ©νκΈ°
πΎ add.cpp
#include <iostream>
// ν€λ μ¬μ©νκΈ°
#include "add.h"
using namespace std;
int subtract(int a, int b); // forward declaration
int main()
{
cout << add(3, 4) << endl;
cout << subtract(2, 3) << endl;
return 0;
}
// definition
int add(int a, int b)
{
return a + b;
}
int subtract(int a, int b)
{
return a - b;
}
πΎ add.h
#pragma once
int add(int a, int b); // forward declaration
728x90
λ°μν
'π©βπ» IoT (Embedded) > C++' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
Comments