$ g++ foo.cpp -ggdb -D_GLIBCXX_DEBUG
$ gdb a.out
> run
Enter a sentence in piglatin to decode hola mundo feliz
(...): Assertion '__pos <= size()' failed.
Program received signal SIGABRT, Aborted.
> backtrace
(...)
#4 0x0000000000402135 in piglatin (latin="hola mundo felizz", size=@0x7fffffffdf8c: 3) at foo.cpp:66
#5 0x0000000000401e57 in main () at foo.cpp:27
> frame 4
> list
62 Word pigLatin;
63
64 for (int i = 0; i < latin.length (); i++)
65 {
66 pigLatin.piglatin[i] = latin[i];
67 }
`pigLatin.piglatin' is an empty string, yet you try to access it from [0: latin.lengh()]
An out of bounds access will not make the string bigger, it is undefined behaviour.