STUDY/C++
C/C++ 여러 변수 값 출력 printf vs cout
Trip the light
2021. 11. 10. 03:30
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int a, b, c;
a = 100;
b = 200;
c = a + b;
// C, 함수
printf("%d, %d, %d\n", a, b, c);
// C++, 객체
cout << a << ',' << b << ',' << c;
}
출력:
100, 200, 300 100,200,300