Ick. Just ick. You can do character arrays (which are the C-style way of doing things) but I'd never use an array when a std::string would do the job better. And it does the job better most of the time. Yes, you should learn how to use character arrays. And learn that most of the time there are better optionsOriginally Posted by ThWolf
Arrays have a lot of pitfalls. Say you make a 20 character array for a person to enter their name. Joe User enters 30 characters. Best case scenario, he just crapped all over your stack. Worst case, he's able to execute arbitrary code by very carefully crafting his string.
If you're serious about learning C++, I strongly encourage you to pay special attention to learning about a few areas, once you've got the basics down:
* Classes. I know you don't know them now. Once you learn to use them you'll wonder how on earth you ever coded without them.
*Standard Template Library (STL). std::string is one of very many powerful tools that you'll find here. You'll find vectors (like arrays, but can grow or shrink in size), lists (optimized for insertion/deletion speed, but you can't easily skip around within them), maps (optimized for very fast insertion/deletion/access of very large amounts of data), and many others.