Anything you get from malloc/realloc remains with you until you explicitly call free(), or your program exits.
Whether you allocate in main and pass the pointer around, or allocate in a function...
Type: Posts; User: Salem
Anything you get from malloc/realloc remains with you until you explicitly call free(), or your program exits.
Whether you allocate in main and pass the pointer around, or allocate in a function...
Whist this is so, the result (either way) is still valid to pass onto realloc.