When I try to do the following I get an error saying I\'m trying to read or write to protected memory.
void func1(int * ptr) { int *ptr_b = new int[5];
No. You're making a common beginner mistake. You're not remembering that pointers are just variables that are passed by value unless you ask for a reference or pointer to them. Change the signature of your function to void func1(int *& ptr)
void func1(int *& ptr)