online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <unistd.h> #include <stdint.h> void memdump(void *p, size_t nmemb, size_t size) { size_t total_bits = nmemb * size * 8; unsigned char *ptr = (unsigned char *)p; for (size_t i = 0; i < total_bits; i++) { unsigned char bit = (ptr[i / 8] >> (7 - (i % 8))) & 0x01; char c = bit ? '1' : '0'; write(STDOUT_FILENO, &c, sizeof(char)); if ((i + 1) % 8 == 0) write(STDOUT_FILENO, " ", 1); } write(STDOUT_FILENO, "\n", sizeof(char)); } int main(void) { int i = 0; int j[2] = {1, 0}; char c = 'a'; char *s = "za"; uint64_t size = 213213; memdump(&i, 1, sizeof(int)); memdump(j, 2, sizeof(int)); memdump(&c, 1, sizeof(char)); memdump(s, 2, sizeof(char)); memdump(&size, 1, sizeof(size_t)); 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