fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // Allocate memory for an integer
  5. int* ptr = malloc(sizeof(int));
  6. if (ptr == NULL) {
  7. // Memory allocation failed
  8. return 1;
  9. }
  10. *ptr = 10;
  11. free(ptr); // Don't forget to free the memory
  12. printf("smsmsm");
  13. return 0;
  14.  
  15. }
  16.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
smsmsm