It will warn you that you never assigned anything to ptr, ptr is uninitialized and points to a random memory location (warning will depend on the warning level).
It's also a good idea to initialize pointers to NULL,
ptr is only a pointer, it points to a memory location, memory which you possibly don't own.
Either, allocate memory on the stack or the heap.
or, the heap:
fgets(myArray, sizeof(myArray), stdin);
char * ptr;
if((ptr = malloc(10 * sizeof(char))) != NULL)
fgets(ptr, 10, stdin);
/* failed to allocate memory */