0

i want to learn c++ and i just bought c++ course.I downloaded mingw and codelite ide.The problem is when i write simple code(Hello world) and press run,the console shows only for a second and disappears.The window with output is not showing correctly in a short term.Idk whats the problem.(The course is Beginning C++ Programming - From Beginner to Beyond)

Mire
  • 1
  • 5
  • 1
    Does this answer your question? [How to stop C++ console application from exiting immediately?](https://stackoverflow.com/questions/2529617/how-to-stop-c-console-application-from-exiting-immediately) – Yksisarvinen Nov 23 '19 at 21:29
  • Try std::cin.get() at end of your main function. I don't know Codelite but there has to be a console-wrapper. Look in your project preferences. – rifkin Nov 23 '19 at 21:29
  • TL;DR - C++ has no knowledge of anything like "console", but you can make your program wait until you press `Enter` by trying to read some useless input, e.g. with `std::cin.get();` (though there are some issues connected with that as well). – Yksisarvinen Nov 23 '19 at 21:31

1 Answers1

0

I figured it out.I think the path for compiler was declared wrong in enviroment variables.Tnx for help guys.

Mire
  • 1
  • 5