save serial data to variable?

Yes, but you'll have to dimension your temporary string, figure out what "size?" is, and terminate your array.

Then you need to fix this:

lat = atoi(temp[0]);