Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C++ #include <cstdlib> and #include <cstdio>

Options
  • 09-03-2013 2:49pm
    #1
    Closed Accounts Posts: 46


    Im working through a book (Beginning C++ for dummies) as practice for learning the language in college.

    The author begins the programmes with the following:
    #include <cstdio>
    #include <cstdlib>
    

    None of my lecturer`s notes to date have included the above.

    Are these C libraries? If so, Is it not bad practice officially, to be using C stuff in C++?


Comments

  • Registered Users Posts: 3,945 ✭✭✭Anima


    It's probably better to avoid using C stuff as there will be better alternatives (better as in fit better with C++). I wouldn't worry to much about includes anyway. If you're not using anything in those files then just omit them.


  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    They're C style libraries, but they're still considered part of the C++ standard library according to all of the docs.

    I don't think using C style IO in C++ is bad practice at all by the way, there are drawbacks but none of them are style or code quality related.


Advertisement