online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <stdbool.h> #include <assert.h> bool is_equal1(char str1[], char str2[]) { for(int i=0; ; i++) { if(str1[i] != str2[i]) return false; if(!str1[i] && !str2[i]) return true; } } bool is_equal2(const char *str1, const char *str2) { while(1) { if(*str1 != *str2) return false; if(!*str1 && !*str2) return true; str1++; str2++; } } int main() { assert(is_equal1("", "")); assert(is_equal1("asdf", "asdf")); assert(!is_equal1("", "asdf")); assert(!is_equal1("asd", "asdf")); assert(!is_equal1("asdf", "")); assert(!is_equal1("asdf", "asd")); assert(is_equal2("", "")); assert(is_equal2("asdf", "asdf")); assert(!is_equal2("", "asdf")); assert(!is_equal2("asd", "asdf")); assert(!is_equal2("asdf", "")); assert(!is_equal2("asdf", "asd")); printf("Pass"); }

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