online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <string> using namespace std; int main() { const int SIZE_ARR = 5; cout << "연산1. 배열 생성 및 초기화"<< endl; int myArr1[SIZE_ARR] {2023, 9, 17, 11, 0}; int myArr2[SIZE_ARR]; for(int loopIdx=0; loopIdx<SIZE_ARR; loopIdx++) {//크기만 선언된 배열에 초기값 입력. myArr2[loopIdx] = 0; } cout << "==============================="<< endl; cout << "연산2. 배열값 검색 및 접근"<< endl; for(int loopIdx=0; loopIdx<SIZE_ARR; loopIdx++) { if(myArr1[loopIdx]==11){ cout << "11 위치는 index = " << to_string(loopIdx) << endl; } } cout << "myArr2[3] = " << to_string(myArr2[3]) << endl; cout << "==============================="<< endl; cout << "연산3. 배열값 변경"<< endl; for(int loopIdx=0; loopIdx<SIZE_ARR; loopIdx++) { myArr2[loopIdx] = myArr1[loopIdx] - 10; cout << "(myArr2)index="<< to_string(loopIdx) <<" --> " << to_string(myArr2[loopIdx]) << endl; } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue