Use vector instead of shared array