Horje
what happens if i acess a freed variable in c Code Example
what happens if i acess a freed variable in c
#include <cs50.h>
#include <stdio.h>

int main(void)
{
  {
    int* px = malloc(sizeof(int));
    *px = 3;
    printf("&px = %i, px = %p\n", *px, px);


    free(px);

    if( px == NULL)
        printf("px is null after free\n");
    else
        printf(" px = %p\n",px);
   }
//     this printf would demonstrate that px is out of scope.
//            printf(" px = %p\n",px);
}




C

Related
anticonstitutionnellement Code Example anticonstitutionnellement Code Example
how to break a loop in c Code Example how to break a loop in c Code Example
fgets langage c Code Example fgets langage c Code Example
unconstrained box flutter Code Example unconstrained box flutter Code Example
injection Code Example injection Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11