Thread: <iostream> under "Windows programming"?

  1. #1
    Beginning game programmer Petike's Avatar
    Join Date
    Jan 2008

    Question <iostream> under "Windows programming"?

    Hi all,
    when I build the "Windows application" (NOT "console application"), is there any reason to use the <iostream> library? Because that library works only with console (I think).
    And one more thing, the <iostream> library is probably one of the most famous libraries for beginning c++ programmers (and for advanced ones too), so wouldn't it be a pity just "throw it out" and not use it?


  2. #2
    Registered User
    Join Date
    Jun 2008
    Some compilers, like code::blocks, can keep up a console windows even in windows programming, so you can still use it there. I agree that it would be a waste of a good library. I believe you could use the stringstream library to keep the iostream interface and put it into a string before printing it using windows.

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Toronto, ON
    No, <iostream> is pretty much useless in a non-console based application.
    <fstream> on the other hand is still quite useful.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    Note that for debugging, you can actually open a console (AllocConsole) and then connect the standard IO streams to the console. It allows you to have both a Windows GUI application, and using printf/cout debug messages. In this case, either stdio.h, cstdio or iostream would be meaningful.

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Beginning game programmer Petike's Avatar
    Join Date
    Jan 2008
    thank you all.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. <iostream> <stdio.h>
    By hero_bash in forum C++ Programming
    Replies: 13
    Last Post: 06-24-2006, 04:56 PM
  2. <iostream.h> or <iostream>?
    By {MaX} in forum C++ Programming
    Replies: 18
    Last Post: 06-05-2006, 12:52 AM
  3. [XP] some controls are hidden in "Windows Classic Style"
    By techi_talk in forum Windows Programming
    Replies: 2
    Last Post: 04-04-2006, 12:55 AM
  4. <iostream.h> or <iostream>?
    By Yumin in forum C++ Programming
    Replies: 30
    Last Post: 01-31-2006, 02:00 AM
  5. <iostream>
    By Ivan! in forum C++ Programming
    Replies: 10
    Last Post: 05-24-2003, 08:04 PM