Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int *a = 10;
- *a = 100;
- int *a = 10;
- int *a = malloc(sizeof(int));
- *a = 100;
- int cell = 10;
- int *a = &cell; // a points to address of cell
- *a = 100; // content of cell changed
- a = malloc(sizeof(int));
- long *a;
- a = malloc(sizeof *a);
- int *a = 10;
- int *a = 10;
- int *a = 10;
- int *a = 10;
- *a = 100;
- int *a;
- a = malloc(sizeof(int));
- *a = 10;
- printf("a=%in", *a);
- free(a);
- int *a = (int *) 10;
- *a = 100;
- int* a = 10;
- *a = 100;
- "Pointer-to-int 'a' becomes 10"
- "Value-pointed-to-by 'a' becomes 100"
- "Value-pointed-to-by 10 becomes 100"
- int* ptr = (int*)10; // You've guessed at a memory address, and probably got it wrong
- int* ptr = malloc(sizeof(int)); // OS gives you a memory address at runtime
- (int*) a = 10;
- (*a) = 100;
- (void*) v = NULL;
- struct Hello {
- int id;
- char* name;
- };
- ...
- struct Hello* hello_ptr = malloc(sizeof Hello);
- hello_ptr->id = 5;
- hello_ptr->name = "Cheery";
- void* malloc(size_t size);
- free(hello_ptr);
- 0.1.2.3.4.5. 6
- C h e e r y
Add Comment
Please, Sign In to add comment