Solving CMD Issues - Hello World Not Showing Up

  • Thread starter Thread starter killa57
  • Start date Start date
Click For Summary
The discussion revolves around a user's attempt to run a "Hello World" program in C++. The user successfully compiled the code but encountered an issue where the command prompt (cmd) does not display the output. The provided code is correct, but the user mistakenly created a Windows application project instead of a Console application, which is necessary for displaying output in cmd. Suggestions included running the program directly from the command prompt by navigating to the executable's directory. Despite attempts to resolve the issue, the user still faced problems with the cmd window closing too quickly. The user expressed gratitude for the quick responses and indicated a willingness to seek further assistance in the future.
killa57
Messages
3
Reaction score
0
Hi all this is my first post and my first program trying to run you guessed it Hello World! okay i compiled it and it was successful but when i run it. my cmd dosent open i used the ;system("PAUSE") the command pops open but it just says to press any key to continue? it dosen't even show the the words hello world? How can i get it to show what i put in the code in the cmd prompt?
 
Technology news on Phys.org
You might start by giving us a clue as to what you're doing - what language, what your code looks like, things like that.
 
Im writing in C++ and this is the code

//my First Program//
#include <iostream>
using namespace std;
int main()
{
cout <<"Hello World";
;return 0;
}
 
How are you trying to run it? This is a console application, so you will need to open a command prompt window for it to run in. Open a command prompt window, then navigate to the directory where the executable for your program is, then type the name of the executable. It should print Hello World.
 
Problem solved sorry guys i made the project as a windows application instead of making the project as a Console application from the start...
I did try the above methods but it just still just opened and closed fast...
But hey thanks guys yall were a quick respons ill have to post more problems as i come across them thanks guys :)
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

Replies
6
Views
3K
Replies
5
Views
2K
Replies
13
Views
2K
  • · Replies 19 ·
Replies
19
Views
5K
Replies
7
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 29 ·
Replies
29
Views
3K
Replies
4
Views
5K
  • · Replies 28 ·
Replies
28
Views
2K