online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <string.h> #define my_sizeof(type) (char *)(&type+1)-(char*)(&type) int main() { char arr[] = "shirley"; printf("arr %s sizeof(arr) %ld strlen %ld \n", arr, sizeof(arr), strlen(arr)); char arr2[10]; printf("arr2 %s sizeof(arr) %ld strlen %ld \n", arr2, sizeof(arr2), strlen(arr2)); char arr3[10] = "Shirley"; printf("arr3 %s sizeof(arr) %ld strlen %ld \n", arr3, sizeof(arr3), strlen(arr3)); /* The below line throws a warning warning: initializer-string for array of chars is too long */ char arr4[4] = "Shirley"; printf("arr4 %s sizeof(arr) %ld strlen %ld \n", arr4, sizeof(arr4), strlen(arr4)); char arr5[7] = "Shirley"; printf("arr5 %s sizeof(arr) %ld strlen %ld \n", arr5, sizeof(arr5), strlen(arr5)); char arr6[] = "Shirley"; printf("arr6 %s sizeof(arr) %ld strlen %ld \n", arr6, my_sizeof(arr6), strlen(arr6)); printf("&arr6+1 %x &arr6 %x\n", (char *)(&arr6+1), (char *)(&arr6)); 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