I tried the solution suggested in the question Having the output of a console application in Visual Studio instead of the console, but none of them are working. Please help.
Asked
Active
Viewed 104 times
-1
-
1iirc, that is not supported. There may be a VS extension to support it, like **VsConsoleOutput** (which I haven't tried myself). – Eljay Aug 23 '22 at 18:47
-
Look up `OutputDebugString()`. This may only work in debug mode. – Thomas Matthews Aug 24 '22 at 00:10
1 Answers
0
I suggest you read this issue carefully.
About how to use OutputDebugString()
I wrote a sample for your reference.
int main()
{
char buffer[100];
sprintf_s(buffer, "check it out: %s\n", "this is a sample");
OutputDebugStringA(buffer);
return 0;
}
Result:

Yujian Yao - MSFT
- 945
- 1
- 3
- 9
-
It is not mandatory to print output in internal console, if one has to do too much extra work. Is it possible to make some setting in Visual Studio IDE so that it works with simple "cout" ?? – Pawan Kumar Aug 24 '22 at 09:40
-
@Pawan Kumar , I am sorry to tell you that the current function of VS cannot realize this idea. – Yujian Yao - MSFT Aug 25 '22 at 07:21