Quote:Original post by TheUnbeliever, all that does is reserve 5 * sizeof(int) bytes on the stack, and gives you myarray as a pointer to that bit of memory. You can then use *myarray interchangeably with myarray[0].int myarray[5]
This is not perfectly true. An array in C is not a pointer, as can be seen from the low-level operations necessary to access one of its elements. To access element i in array a, add i to a and get the value there. To access element i in a buffer pointed to by p, get the value of p, add i to it, and get the value there.
A stack array requires one less memory access than a pointed-to buffer. Of course, this is usually incompatible with argument passing, so stack arrays decay into pointers. But they are not pointers.
Back to the topic: use std::string. You don't need char* in C++ to manipulate strings, and you apparently do not have the required level of experience to get reasonable performance out of char* anyway.