why is c++ opening my windows terminal and VS Code terminal? - c++

Whenever I ask for the user input (using C or C++), VS Code will open my windows terminal, ask for input, and then close and ask for the same input in the integrated VSC terminal.
Now, this should be a very simple fix but no matter what I google, I can't find anyone having the same issue.
Also, when I enter input into the windows terminal, it doesn't use that information at all. It just closes after all of the console input operations are complete. Only the VS Code's integrated terminal does anything useful.
Anyways, does anyone know how I can disable my windows terminal from opening up when running C/C++ programs?
Tried googling for help but couldn't find anything directly related to what I was experiencing

Related

Visual Studio Console

Sorry if I'm being dense, but I can't find the console for Visual Studio. I'm in the subsystem:windows mode because I'm writing an app that requires me to be in this mode. Is there a different method of debugging that doesnt use the console? I have some print statements in my C++ program but I can't find where they are printed, can anyone help me find it?
You can either use an external terminal, ex. xterm, but I think this guide will help you to open and use an integrated terminal in Vscode:
https://code.visualstudio.com/docs/terminal/basics
Your print statements are currently just lost - you have chosen not to have a console, since you're in a Windows susbsystem.
There's OutputDebugString, which does write to the Visual Studio "Output" tab. But it won't format the output for you. You can do some std::streambuf magic to make std::cout forward to OutputDebugString, so you get std::ostream formatting.

Youtube-DL.exe Closes After Launching Command Line

I've used YouTube-dl successfully on my mac for quite some time.
I downloaded YouTube-dl.exe (after downloading Microsoft Visual C++ I was told a newer version already exists on my computer - it also says Python is not required), but when I launch the executable, it briefly opens a command line window but then closes immediately and nothing else happens. I've tried Googling and even went to the IRC support chat (who turned out to be more rude than helpful) to no avail. Any ideas what to do?
youtube-dl is a command-line application. To use it directly, start a terminal windows by pressing Win+R, and entering cmd. To get to know the command-line interface, you probably want to consult a tutorial.
If you were looking for a graphical application, use one of the graphical frontends instead; for instance, youtube-dlg.

C++/WINAPI find out whether program is outputting to cmd or bash

I am currently writing a toy-compiler in my free-time in C++ and I am using Visual Studio do to my development work. Although I am on a Windows System, I have replaced my standard Console with the msysgit bash version. Now, I am trying to implement color-coded error messages which work fine in bash, but don't work in cmd. I am coloring my text using the bash color keys like \x1B[0m etc... Now, the problem is that when the compiler outputs error messages to the console, someone using cmd.exe as their default console will see a garbled mess of seemingly random letters making the error message hard to decipher. One solution I found to be working is completely disabeling color coding on Windows systems which works, but is kind of inconvinient. I am looking for a way to find out whether the console to which the compiler is outputting to is cmd.exe or bash.exe. I have looked through MSDN and didn't find anything particulary useful.

SFML write to the console

I'm writing a SFML project in c++, using Code::Blocks in Windows for my IDE. When I run the program through Code::Blocks, it opens a console window. Is there any simple way to write to that? I tried std::cout<<"console output"<<std::endl;, but that doesn't seem to do anything. I really just want this for debugging purposes, such as printing out an exception before the program closes. I haven't been able to find documentation on writing to a console. The only thing I found is writing to the main screen with sf::Text, which isn't really what I want.

Console application in C++ for smart devices (WinCE)?

I am new in developing application for WinCE 5.0. I want to start from "Hello world" program or console application. But I couldn't find anything like that or any other sample applications to start from.
I am using Visual Studio 2005. I created new project >> visual C++ >> Win32 smart device project >> console application >> finish.
The project compiles fine. I was trying simple
printf("Hello world");
But When I ran in smart phone 2003 emulator, it showed no output.
I couldn't find a good tutorial to start from. Please suggest me some good tutorials or sample applications to start from.
Thanks in advance.
What does the log say? That the application has terminated successfully with return code 0x0?
If you did not put anything to stop the application it might be that it runs good and terminates without you noticing it. Try to add a scanf or Sleep(5000) after the printf statement so things will be visible. You can also compile it in debug mode and put a breakpoint after the printf statement and see the results.
In addition, I am not too familiar with Windows Mobile and its incarnations (smart phone 2003 being one of them), but I am not sure how it handles a printf. You can try create an MFC application and use the MessageBox to display your text.
OK. I just tried the two options and there is no CMD windows in Windows Mobile (Smartphone or PocketPC) so the application runs successfully, but prints nothing.
Use the MFC option or deploy your application to a Windows CE 5.0 device emulator image. I have not tried that download myself, but it says that it should save you the hassle of handling Platform Builder. Note that you might be missing some components in the image down the road, but I suppose that for practicing purposes it should suite you just fine.
WinMo/Pocket pC devices have no console, so your output went nowhere. You can always add a console on like PocketConsole.
there is CMD windows in POCKET PC 2003 emulator you can try it using visual basic code