Results 1 to 2 of 2

Thread: Supa quick question

  1. #1
    NOMADMAN
    Guest

    Supa quick question

    How do I cin and cout char arrays?

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    PHP Code:
        char c[20];
        
    cin >> c;
        
    cout << c
    Note that this only allows 19 characters and does NOT check for overflow, so I rather see you using the Standard Library:

    PHP Code:
    include <string>

    string s;
    cin >> s;
    cout << s
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width