online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
using System; class Program { static int Main(string[] args) { // Defaults string apiKey = ""; string apiBase = "http://localhost/v1"; // Parse: --name value for (int i = 0; i < args.Length; i++) { if (args[i] == "--api-key" && i + 1 < args.Length) apiKey = args[++i]; else if (args[i] == "--api-base" && i + 1 < args.Length) apiBase = args[++i]; else if (args[i] == "--help" || args[i] == "-h") { PrintHelp(); return 0; } } // Beispiel: apiKey ist optional if (string.IsNullOrWhiteSpace(apiKey)) { Console.WriteLine("Hinweis: Kein --api-key übergeben (optional)."); // wenn Pflicht: return 2; } Console.WriteLine($"apiBase={apiBase}"); Console.WriteLine($"apiKey={(string.IsNullOrEmpty(apiKey) ? "(leer)" : "***")}"); return 0; } static void PrintHelp() { Console.WriteLine("Usage:\n\tprogram.exe [--api-key <key>] [--api-base <url>]\n\nDefaults:\n\t--api-base http://localhost/v1"); } }

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