Is it true that whether the architecture is big or little endian ,only the memory layout of numbers differ,that of the string is the same.
That's generally not true. Depending on the circumstances, more than one byte might be used for characters, in which case there is a difference between little endian encoding of characters and big endian encoding of characters.