<iostream> under "Windows programming"?

This is a discussion on <iostream> under "Windows programming"? within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, when I build the "Windows application" ( NOT "console application") , is there any reason to use the ...

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

    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?
    Thanks.

    Petike

  2. #2
    Registered User
    Join Date
    Jun 2008
    Posts
    127
    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
    Location
    Toronto, ON
    Posts
    3,545
    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
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    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.

    --
    Mats
    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
    Posts
    64
    OK,
    thank you all.

    Petike

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, 05:56 PM
  2. <iostream.h> or <iostream>?
    By {MaX} in forum C++ Programming
    Replies: 18
    Last Post: 06-05-2006, 01: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, 01: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, 09:04 PM

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