Visual C++ (2017) - Command Window

I recently switched to using Visual C++ (beginner) after using MATLAB for a while.
I have been trying to make use of the command window to execute certain lines of code. However, I'm faced with an error that says 'The expression cannot be evaluated while in design mode.' even for a simple expression as '? 2+2'. What must I do? I don't know what a 'design mode' is either. So I have no idea what the compiler is trying to tell me. Please help.

Last edited on
See: https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(VS.CommandWindow)&rd=true
TL;DR: The command window does not execute C++ statements. It allows you to give commands to Visual Studio itself via text. For example to automate certain tasks.

Visual Studio does not have a REPL (read-eval-print loop) for C++. In fact to my knowledge the only C++ REPL is in ROOT C++ and last time I checked (a few years ago) that was a slightly non-standard dialect of C++.
In contrast to more dynamic languages like MATLAB, Maxima, or Python, the way C++ is designed makes it difficult for a REPL environment to be useful.
Thanks for your reply!
Topic archived. No new replies allowed.