C++, when I put return 0 in a function and use the function main, the system still keep working

My idea is to write a exit function to terminate the whole system, so I wrote the function int exit_c(), and put it in the while loop, but it seems that the system keeps working. int main() { while (true) { exit_c(); } system("pause"); return 0; } int exit_c() { cout << "close" << endl;… Read More C++, when I put return 0 in a function and use the function main, the system still keep working

Python BeautifulSoup find_all() method return unnecessary element

I’m having trouble with scrapping elements with the find_all() method. I am looking for the <li class=’list-row’>…..</li> tag but after scrapping it returns <li class=’list-row reach-list’> tags with different classes too. I tried with the select() method too. Here’s the python code: with open(‘index.html’, ‘r’) as f: contents = f.read() soup = BeautifulSoup(html,"html.parser") main_block =… Read More Python BeautifulSoup find_all() method return unnecessary element

Javascript simple function returning undefined after result

That’s the function: function randomNum(n) { const numbers = [1,2,3,4,5,6,7,8,9,10] if(numbers.includes(n)) { console.log(‘ok’) } else { console.log(‘Choose a value between 1 and 10′) } } console.log(randomNum(5)) Sorry if it’s a simple problem, but i can’t figure it out, i’m kinda new to programing. The function is returning ‘undefined’ after ‘ok’ or ‘Choose a value between… Read More Javascript simple function returning undefined after result