cout << setiosflags(256L) << 123.123;

This is a discussion on cout << setiosflags(256L) << 123.123; within the C++ Programming forums, part of the General Programming Boards category; Hello, when i try to compile this i always get this: a.cpp: In function `int main()': a.cpp:52: invalid conversion from ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    3

    Exclamation cout << setiosflags(256L) << 123.123;

    Hello,

    when i try to compile this i always get this:

    a.cpp: In function `int main()':
    a.cpp:52: invalid conversion from `long int' to `std::_Ios_Fmtflags

    What's wrong with ' cout << setiosflags(256L) << 123.123; '?

    pls help

    thanks
    jochen

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    3
    Hi

    gcc (g++) 3.x
    I always get an information message because of some old headers, i shouldn't use anymore.
    Could this be the reason?

    Why did you write #include <iostream> and not #include <iostream.h> ?

    thx
    jochen

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    3
    Hi!

    @vVv: Yes, it works!

    But could you please explain in some words, what ``using namespace std;'' does mean?

    thanks
    jochen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework due tonight! help please!!
    By Andy717 in forum C++ Programming
    Replies: 41
    Last Post: 04-07-2005, 02:18 PM
  2. what's does \a do in cout << "\a"
    By Jez_Master in forum C++ Programming
    Replies: 1
    Last Post: 04-08-2002, 07:57 AM
  3. can't cout << hex << 'T'; what's wrong?
    By andre in forum C++ Programming
    Replies: 1
    Last Post: 03-19-2002, 07:53 PM
  4. simple question (cout << "two words")
    By bleach in forum C++ Programming
    Replies: 3
    Last Post: 12-29-2001, 12:49 PM
  5. cout << double
    By Seron in forum C++ Programming
    Replies: 2
    Last Post: 12-28-2001, 10:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21