Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
int main() { // Allocate memory int *ptr; ptr = calloc(4, sizeof(*ptr)); // Write to the memory *ptr = 2; ptr[1] = 4; ptr[2] = 6; // Read from the memory printf("%d\n", *ptr); printf("%d %d %d", ptr[1], ptr[2], ptr[3]); return 0; }
2
4 6 0