online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
///----------------------------------------------------------------------------| /// -std=c++17 /// Исходник в utf-8 ///----------------------------------------------------------------------------: #include <iostream> #include <string> ///----------------------------------------------------------------------------| /// Calculator. ///----------------------------------------------------------------------------: namespace Calculator { using T = double; struct Instance { Instance() = default; Instance(std::string_view s){ parse(s); } ///---------------------| /// Парсинг строки. | ///---------------------: void parse(std::string_view s) { /// TODO ... } ///---------------------| /// Само вычисление. | ///---------------------: T calc() { /// TODO ... return 0; } ///---------------------| /// Тест. | ///---------------------: static bool test(std::string_view s, T r) { Instance instance; instance.parse(s); return instance.calc ( ) == r; } private: }; } #define TEST(a) Calculator::Instance::test(#a, a) ///-----------------------------| /// Тесты. | ///-----------------------------: bool tests() { bool isgood = true; isgood &= TEST(3 - 3); isgood &= TEST(4 * 5); return isgood; } ///----------------------------------------------------------------------------| /// main. ///----------------------------------------------------------------------------: int main() { setlocale(0, ""); std::wcout << L"Привет, я ваш Calculator!\n\n"; std::wcout << L"Тесты: " << (tests() ? L"ОТЛИЧНO" : L"ПЛОХО\a") << '\n'; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue