SHARE
TWEET

Untitled

a guest Sep 5th, 2012 48 Never
  1. #include <stdio.h>
  2.  
  3. void freeStr(char **str) {
  4.     *str = NULL;
  5. }
  6. int main() {
  7.     char* str = (char *)"some string";
  8.     printf("Before: %s\n", str);
  9.     freeStr(&str);
  10.     printf("After: %s\n", str);
  11.     return 0;
  12. }
RAW Paste Data
Top