Coutsos wrote:
As far as I know, yes, but they aren't very good. Ultimately you must ask, do you really need to clear the console screen?
Indeed, if you do that, how does the user copy and paste output from your program? If they forget to do so and the program clears the screen, that output is gone. Or if it just scrolls the page several lines to mimic clearing the screen the user has a bunch of useless blank lines.
As for an array of strings, don't use C-strings (character arrays) or arrays. Instead use a vector of std::string objects.
code: |
#include <vector>
#include <string>
int main()
{
std::vector<std::string> foo(20);
// instead of: std::string foo[20];
return 0;
} |
Vectors are beautiful because they permit resizing and keep track of their own size.