Thread: List of Include functions

  1. #1
    Registered User
    Join Date
    Feb 2008
    Location
    Maine, USA
    Posts
    1

    List of Include functions

    Ello, I'm new to C++ programming. I'm looking for a list of common includes and the functions they provide. For instance I know that <iostream> gives me cOut and cIn, is there anything else it offers? What are the other common includes? I am familar with BASIC, HTML, & Jscript. Where can I find a decent tutorial on writing a simple Win32 program? I don't care to learn about writing console programs (for I can do ~ anything console related with QB4.5). Thank you for your help.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by technical_13 View Post
    Ello, I'm new to C++ programming. I'm looking for a list of common includes and the functions they provide. For instance I know that <iostream> gives me cOut and cIn, is there anything else it offers? What are the other common includes?
    There's 18645287 of them out there, but I'm partial to cplusplus.com.

    And you should note very carefully that cOut and cIn are most emphatically not defined in iostream.

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    C++ is case sensitive. <iostream> defines cin and cout.

    cplusplus.com is a good reference, but it doesn't replace a good book. There are a lot of standard function, objects, features, and even style elements that a book would help familiarize you with.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    This has most of them: http://www.cppreference.com/index.html
    MSDN has all (plus a lot of M$ specific stuff), but it's probably a bit too much for a beginner.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    As a note, even if you don't want to write console programs, it's good to start with them to properly learn C++. No, you really don't have to learn about how to make pretty output or how to colorize it, but you may need to use it to get the grasp of the language first before venturing into GUI programming. It's not a cakewalk, writing a GUI...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    coder
    Join Date
    Feb 2008
    Posts
    127
    Quote Originally Posted by technical_13
    For instance I know that <iostream> gives me cOut and cIn, is there anything else it offers?
    <iostream> lets you include almost all c++ library features, except for some "extra" like c++ containers, etc.
    If you want to create a GUI program then you'll need to search for an extra library, and install it, if you don't have it yet.
    By the way, as Elysia suggested, starting "just" writing console programs with c++ wouldn't be a bad idea: like you I've wrote several programs with Qbasic 4.5, and I can swear that it's not comparable with c++ complexity (see pointers and more).
    Also, any programmer writing a GUI would be lost without the help provided by a console.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by carlorfeo View Post
    <iostream> lets you include almost all c++ library features, except for some "extra" like c++ containers, etc.
    Is not. It allows you to use streams, such as cout and cin and writing/reading files.
    Does not let you use containers, such as vector, map, or lots of other things.
    Any non-newbie programmer will use lots of other features, oh yes, they will...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    coder
    Join Date
    Feb 2008
    Posts
    127
    Quote Originally Posted by Elysia
    Does not let you use containers, such as vector, map, or lots of other things.
    yeah, that's exactly what I said.
    I was wrong saying "<iostream> lets you include almost all c++..." indeed.
    I'm considering STL features as "extras", since we are talking to a newbie.
    In my first experience I've only needed <iostream> to make lots of programs, so for a beginner it may be enough.

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    But your claim that it includes "almost all" of C++ is wrong.
    It contains only a very small subset.
    New/delete for example? New is located in the header <new>.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It allows you to use streams, such as cout and cin and writing/reading files.
    No file streams in <iostream>. Those are in <fstream>.

    By the letter of the current standard, <iostream> allows the use of cin, cout and their wide variants, nothing else.
    By implementation necessities and the letter of the next standard, <iostream> also allows basic_iostream, its base hierarchy basic_istream, basic_ostream, basic_ios and ios_base, all typedefs of the hierarchy, endl and a few other key manipulators.


    You don't need a header to use new and delete. The <new> header is for very specialized stuff, like std::nothrow and std::set_new_handler.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  11. #11
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    @carlorfeo
    On the contrary, STL features such be emphasized, and encouraged as much as possible.

    iostream only includes 4 static object instances. I would hardly call that "almost all c++ library features".

    <string>,<vector>, and <fstream> are just a few of the other commonly used headers that every beginner should know about.
    Last edited by King Mir; 02-26-2008 at 04:04 PM.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  12. #12
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    strings & vectors are some of the biggest selling points (next to classes) for C++. Even if you ignored all the rest of the STL -- using string & vector would drastically reduce your headaches as well as improve your code stability.

  13. #13
    coder
    Join Date
    Feb 2008
    Posts
    127
    Quote Originally Posted by carlorfeo
    I was wrong saying "<iostream> lets you include almost all c++..." indeed.
    answers:
    Quote Originally Posted by Elysia
    But your claim that it includes "almost all" of C++ is wrong.
    Quote Originally Posted by King Mir
    iostream only includes 4 static object instances. I would hardly call that "almost all c++ library features".
    should I admit my errors with a bold red ultrasized font next time?
    you are encouraged to read well before writing.

    Anyway, don't forget that this thread has been started by a c++ newbie, so talking about vectors, maps and streams would probably make him confused, instead of give him help.

    In my opinion, learning how to implement e.g. a linked list should happen before learning "ready-to-use" c++ lists or such containers. They are very useful, but a beginner will probably use them in a wrong way (like I did myself with strings), if he doesn't understand how they exactly work.

    ps: I don't need to include <string> to use strings: is that compiler dependant?

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yes, some headers include other dependencies, so sometimes you get headers for "free."
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #15
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Quote Originally Posted by carlorfeo View Post
    answers:

    should I admit my errors with a bold red ultrasized font next time?
    you are encouraged to read well before writing.

    Anyway, don't forget that this thread has been started by a c++ newbie, so talking about vectors, maps and streams would probably make him confused, instead of give him help.
    I still disagree with your claim that the rest of the standard library is "extra".

    Quote Originally Posted by carlorfeo View Post
    In my opinion, learning how to implement e.g. a linked list should happen before learning "ready-to-use" c++ lists or such containers. They are very useful, but a beginner will probably use them in a wrong way (like I did myself with strings), if he doesn't understand how they exactly work.
    Again, I disagree. I think a beginner should learn to use standard libraries/features before learning some of the basics of how those libraries are implemented. I mean, yes every
    computer science major should know how a linked list works, but it's not a critical part of the language, and can be learned after the habit of using libraries is established. Otherwise, a beginner is tempted to reinvent the wheel every time he encounters a new challenge, instead of finding a tried and tested standard alternative.

    Ready to use containers are the way to do things, whether you are a beginner or an expert.
    Last edited by King Mir; 02-26-2008 at 04:53 PM.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting linked list please help with CODE
    By scarlet00014 in forum C Programming
    Replies: 3
    Last Post: 09-27-2008, 11:24 PM
  2. Need help sorting a linked list. Beginner
    By scarlet00014 in forum C Programming
    Replies: 1
    Last Post: 09-27-2008, 06:16 PM
  3. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 10:10 AM
  4. help with finding lowest number entered
    By volk in forum C++ Programming
    Replies: 12
    Last Post: 03-22-2003, 01:21 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM