implement task4_6

implement task4_6
Minor update for task4_4: replace shared_ptr with shared_array for char[]
fix compiler warnings