I haven't managed to compile any of your codes posted here (but the one you looked up online) nor do I understand why they should work.

-Arrays must have a constant size. You may not change it...