online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(const void *a, const void *b) { return *(char*)a - *(char*)b; } int same_digit(int a, int b) { char A[22], B[22]; sprintf(A, "%d", a); sprintf(B, "%d", b); qsort(A, strlen(A), sizeof *A, cmp); qsort(B, strlen(B), sizeof *B, cmp); return !strcmp(A, B); } int main() { printf("%d\n", same_digit(1234, 4321)); printf("%d\n", same_digit(1234, 1111)); }

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