#include <stdio.h>
int main(void) {
// Allocate memory for an integer
int* ptr
= malloc(sizeof(int)); if (ptr == NULL) {
// Memory allocation failed
return 1;
}
*ptr = 10;
free(ptr
); // Don't forget to free the memory return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgICAvLyBBbGxvY2F0ZSBtZW1vcnkgZm9yIGFuIGludGVnZXIKICAgIGludCogcHRyID0gbWFsbG9jKHNpemVvZihpbnQpKTsKICAgIGlmIChwdHIgPT0gTlVMTCkgewogICAgICAgIC8vIE1lbW9yeSBhbGxvY2F0aW9uIGZhaWxlZAogICAgICAgIHJldHVybiAxOwogICAgfQogICAgKnB0ciA9IDEwOwogICAgZnJlZShwdHIpOyAvLyBEb24ndCBmb3JnZXQgdG8gZnJlZSB0aGUgbWVtb3J5CiAgICBwcmludGYoInNtc21zbSIpOwogICAgcmV0dXJuIDA7Cgp9Cg==