Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pointers to structures
Index -> Programming, C++ -> C++ Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Andy




PostPosted: Mon Feb 14, 2005 10:17 pm   Post subject: (No subject)

system("cls")
u need to include window.h or was it windows.h w.e try both
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Tue Feb 15, 2005 12:00 am   Post subject: (No subject)

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.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 17 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: