console

How do I compile a C/C++ program through windows command prompt?

核能气质少年 提交于 2020-01-05 02:55:09
问题 Im new to the C/C++ programming language an so far have used the Code::blocks program for writing and compiling programs. However I need to know how to compile a program via windows command prompt as I need to access the assembly code created. My compilers are mingw32-gcc.exe, mingw32-g++.exe 回答1: Please read Compile Programs with MinGW -- A Guide for New Users. To make gcc produce assembler code, use -S option: -S Stop after the stage of compilation proper; do not assemble. The output is in

How to create a Visual c++ MFC console project in visual studio 2017

依然范特西╮ 提交于 2020-01-04 13:42:00
问题 I've tried to program a socket in Visual Studio 2017, but I can't find the console application in Visual Studio 2017 like this: Instead, I just see this window and the wizard like this: So how can I create a C++ console project with MFC like an earlier version of Visual Studio, or I have to reinstall visual studio 2015. 回答1: Visual Studio 17 has a different dialog for adding new projects. Select Installed -> Visual C++ -> Windows Desktop -> Windows Desktop Wizard Select Console application

How to create a Visual c++ MFC console project in visual studio 2017

ぐ巨炮叔叔 提交于 2020-01-04 13:41:07
问题 I've tried to program a socket in Visual Studio 2017, but I can't find the console application in Visual Studio 2017 like this: Instead, I just see this window and the wizard like this: So how can I create a C++ console project with MFC like an earlier version of Visual Studio, or I have to reinstall visual studio 2015. 回答1: Visual Studio 17 has a different dialog for adding new projects. Select Installed -> Visual C++ -> Windows Desktop -> Windows Desktop Wizard Select Console application

How Do I save variables to a new text file so that those variables are loaded the next time the program runs?

青春壹個敷衍的年華 提交于 2020-01-04 06:13:13
问题 new C#er here. I'm making a console based RPG. It's coming along quite well, but I need to find out how to save the game. I would guess that there is a way to save variables from my app into a text file that can be used to load the variables when the application is run again. Unfortunately I have no idea where to start. Also I need a way to go to a point in the code when loading a save file. Some of my variables include: int xCoordinate, yCoordinate, hp, hpmax, level; Any sample code would be

How Do I save variables to a new text file so that those variables are loaded the next time the program runs?

痞子三分冷 提交于 2020-01-04 06:11:24
问题 new C#er here. I'm making a console based RPG. It's coming along quite well, but I need to find out how to save the game. I would guess that there is a way to save variables from my app into a text file that can be used to load the variables when the application is run again. Unfortunately I have no idea where to start. Also I need a way to go to a point in the code when loading a save file. Some of my variables include: int xCoordinate, yCoordinate, hp, hpmax, level; Any sample code would be

How Do I save variables to a new text file so that those variables are loaded the next time the program runs?

时间秒杀一切 提交于 2020-01-04 06:10:10
问题 new C#er here. I'm making a console based RPG. It's coming along quite well, but I need to find out how to save the game. I would guess that there is a way to save variables from my app into a text file that can be used to load the variables when the application is run again. Unfortunately I have no idea where to start. Also I need a way to go to a point in the code when loading a save file. Some of my variables include: int xCoordinate, yCoordinate, hp, hpmax, level; Any sample code would be

is there a way to check if external data is piped to a program or if program runs on its own?

若如初见. 提交于 2020-01-04 05:37:24
问题 That is the data is already provided by another program, or user must type it manually. I mean these two states: dir /b /s *.* | myprogram and myprogram In second case the program would be waiting for user input. Is there a way to prevent that ? 回答1: POSIX has isatty() , whereas Visual C++ has _isatty() , both of which will return true if a file descriptor is a terminal or command line, e.g. isatty(fileno(stdin)) . 回答2: Yes. Use GetStdHandle to get the STD_INPUT_HANDLE and then check that the

Style a JTextPane to have console-like formatting?

人盡茶涼 提交于 2020-01-04 04:45:10
问题 Is there a way to make the text in a JTextPane look similar to that of console output? By that I mean, basically, how each character is the same width, so that things like ASCII art, or spacing indentation would work correctly. For example, currently, if I type "First" and then 5 spaces, and then on a new line "Second" and then 4 spaces, the two lines do not end in the same position, so if there was text following those spaces, the text would not be aligned. I don't know if it changes

How to trigger a C# function at a certain time with millisecond precision?

梦想与她 提交于 2020-01-04 04:34:12
问题 I have 2 computers whose time is synchronized through NTP which assures that the time will differ only by a few milliseconds. One of the computers will send a message through TCP to the other one to start a certain c# function at a specified time in the future on both computers. My question is: How can i trigger a function in C# at a certain time with millisecond precision (or better)? I need to do that in the program code ( so Task Scheduler or other external program will not help). Always

Console Mouse Input not working

a 夏天 提交于 2020-01-04 03:44:06
问题 I am working on a console project in c++ with visual studio, in which the mouse is doing all the input stuff. It is working fine on windows 7, but not on windows 10. I'll show you some code, which is a very simplefied version, of my actual code. But here is the same: working on win7, not on win 1 #include <stdio.h> #include <windows.h> void MouseEventProc(MOUSE_EVENT_RECORD); VOID ResizeEventProc(WINDOW_BUFFER_SIZE_RECORD); VOID KeyEventProc(KEY_EVENT_RECORD); VOID GetInputEvents(VOID); void