Thread: stringstreams

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    stringstreams

    I need to insert a character array to be part of string stream, but when I output the stream, the array does not appear as it was typed. It comes out as weird characters. This is basically what the code is doing.

    Code:
    char word[4];
    strinstream sentence;
    cin >> word;
    
    sentence << "blah blah blah" << word << "blah blah";
    cout << sentence.str().c_str();

  2. #2
    Registered User
    Join Date
    Aug 2004
    Posts
    20
    figured it out i think. Sorry to bother.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A problem with loops and Stringstreams
    By mintsmike in forum C++ Programming
    Replies: 1
    Last Post: 03-28-2009, 11:08 AM
  2. stringstreams problem
    By Mostly Harmless in forum C++ Programming
    Replies: 1
    Last Post: 06-11-2007, 09:13 PM
  3. StringStreams
    By Scarvenger in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2007, 11:32 PM
  4. stringstreams
    By Victor4015 in forum C++ Programming
    Replies: 1
    Last Post: 11-16-2005, 05:01 PM
  5. stringstreams help i know you guys will know
    By sswaters in forum C++ Programming
    Replies: 7
    Last Post: 10-22-2005, 07:46 PM