my code:
#include<iostream>
int main()
{
int a{};
std::cout<<"enter number";
std::cin>>a;
}
the build log for this code:
C:\WINDOWS\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ ConstructorsAndDestructors - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/AT/Documents/OOP_basics/Constructors&Destructors'
C:/MinGW/bin/g++.exe -c "C:/Users/AT/Documents/OOP_basics/Constructors&Destructors/main.cpp" -g -O0 -Wall -o Debug/main.cpp.o -I. -I.
C:/MinGW/bin/g++.exe -o Debug/ConstructorsAndDestructors @"ConstructorsAndDestructors.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/AT/Documents/OOP_basics/Constructors&Destructors'
====0 errors, 0 warnings====
Furthermore, when I build the same code on a different project, it works correctly, and the console stays till I input the number and waits for pressing any key to exit.
Following is the build log when I build the same code on a different project
C:\WINDOWS\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ AcessingClassMembers - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/AT/Documents/OOP_basics/AcessingClassMembers'
C:/MinGW/bin/g++.exe -c "C:/Users/AT/Documents/OOP_basics/AcessingClassMembers/main.cpp" -g -O0 -Wall -o Debug/main.cpp.o -I. -I.
C:/MinGW/bin/g++.exe -o Debug/AcessingClassMembers @"AcessingClassMembers.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/AT/Documents/OOP_basics/AcessingClassMembers'
====0 errors, 0 warnings====
As there's no visible difference in the build logs, then what is causing problem.