Identifier

Reserved Words

์‚ฌ์šฉ๊ฐ€๋Šฅ ๋ฌธ์ž

  • ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789
  • ์˜ˆ์•ฝ์–ด๋Š” ์•ˆ๋œ๋‹ค.

Variable Assignment

#include <iostream>

int main(){
    int x;		// ๋ฉ”๋ชจ๋ฆฌ์— integer ์ž๋ฃŒํ˜•์„ ๋„ฃ์„ ๊ณต๊ฐ„๋งŒ๋“ค๊ณ , ๊ทธ ์ด๋ฆ„์„ x๋ผ ํ•˜๊ฒ ๋‹ค.
}

Variable, Constant

C์™€ ๊ฐ™์œผ๋ฏ€๋กœ ๋งํฌ๋กœ ๋Œ€์ฒดํ•˜๊ฒ ๋‹ค. 02. Basic Types

Standard Input & Output

๊ธฐ๋ณธ์ ์œผ๋กœ iostream ํ—ค๋”ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€์„œ ์‚ฌ์šฉํ•œ๋‹ค. iostream.hย ํ—ค๋” ํŒŒ์ผ์€, c++์— ์žˆ๋Š” ์ž…์ถœ๋ ฅ์„ ์œ„ํ•œ ํ—ค๋”ํŒŒ์ผ์ด๋‹ค. C์–ธ์–ด์˜ย stdio.hย ์™€ ๊ฐ™์€ ์—ญํ• ์„ ํ•œ๋‹ค.

์ถœ๋ ฅ (cout)

#include <iostream>
 
int main(){
    std::cout << โ€œPlease enter two intger values: โ€œ;
}

namespaceย ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ ์žˆ์–ดย std::ย ๋ฅผ ์“ฐ์ง€ ์•Š๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

#include <iostream>
 
using namespace std;
int main(){
    cout << โ€œPlease enter two intger values: โ€œ;
}

์ž…๋ ฅ (cin)

#include <iostream>
 
int main(){
    std::cin >> value1 >> value2;
}

์—ฌ๋Ÿฌ๊ฐœ๋ฅผ ํ•œ๋ฒˆ์— ์ž…๋ ฅ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.

๋งˆ์ฐฌ๊ฐ€์ง€๋กœ, namespace ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ ์žˆ์–ด std:: ๋ฅผ ์“ฐ์ง€ ์•Š๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

#include <iostream>
 
using namespace std;
int main(){
    cin >> value1 >> value2;
}

Operator

๋งˆ์ฐฌ๊ฐ€์ง€๋กœ C์™€ ๊ฐ™์œผ๋ฏ€๋กœ ๋งํฌ๋กœ ๋Œ€์ฒดํ•˜๊ฒ ๋‹ค. 04. Operator