Two problems with that code
1. theData in Data() is just a local variable, so line 12 us useless, does nothing.
2. arrays declared inside function can not be returned from the function, attempting to do so will cause sig faults, as you have found out.
To correct the problem, move line 9 to line 17 so that it is declared inside main() instead of Data, then pass it as the parameter to Data(). You will also have to pass the size of the array as another argument to Data() because sizeof does not return the size of an array when used with a pointer.