online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <string.h> // Function to swap values at two pointers void swap(char* x, char* y) { char temp; temp = *x; *x = *y; *y = temp; } void permute(char* a, int l, int r) { int i; if (l == r) printf("%s\n", a); else { for (i = l; i <= r; i++) { swap((a + l), (a + i)); permute(a, l + 1, r); swap((a + l), (a + i)); // backtrack } } } int main() { char str[] = "ABCD"; int n = strlen(str); permute(str, 0, n - 1); return 0; }

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