https://www.codechef.com/viewsolution/55181201
Problem Code:CHN15A
It is showing a runtime error. I dot understand why?
int arr[j];
β
int arr[a];
2 Likes
Pay attention to compiler warnings!
[simon@simon-laptop][18:34:48]
[~/devel/hackerrank/otherpeoples]>./compile-latest-cpp.sh
Compiling dudu_0-CHN15A.cpp
Executing command:
g++ -std=c++17 dudu_0-CHN15A.cpp -O3 -g3 -Wall -Wextra -Wconversion -DONLINE_JUDGE -D_GLIBCXX_DEBUG -fsanitize=undefined -ftrapv
dudu_0-CHN15A.cpp: In function βint morgi(int, int)β:
dudu_0-CHN15A.cpp:7:14: warning: βjβ is used uninitialized in this function [-Wuninitialized]
7 | int arr[j];
| ^
Successful
Thanks bro!!
thanks bro!!but still i am getting the error