Thread: stdlib.h in C

  1. #1
    Registered User
    Join Date
    Mar 2019
    Posts
    51

    stdlib.h in C

    It is said that we can use cstdlib and stdlib.h header file as well.

    My question is how can we use C language header file to fetch prototype of functions here in CPP too? Are C and CPP header files available for both, in C and CPP too?

  2. #2
    Informer -Adrian's Avatar
    Join Date
    Jan 2013
    Posts
    799
    For C++, use <cstdlib> & Co. (if necessary). In principle, you cannot rely on C Standard Library headers like <stdio.h> being bundled with your C++ compiler and thus should avoid using them in your code.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    3,652
    Please do not duplicate your posts!!!
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,408
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stdlib or Limits
    By ItzBlue in forum C Programming
    Replies: 3
    Last Post: 12-20-2014, 10:32 AM
  2. stdlib help!!
    By clique in forum C Programming
    Replies: 5
    Last Post: 10-08-2008, 10:57 AM
  3. Compiler won't take #<stdlib.h>
    By omnificient in forum C Programming
    Replies: 5
    Last Post: 12-11-2007, 02:36 PM
  4. Stdlib header help
    By MaGaIn in forum C++ Programming
    Replies: 8
    Last Post: 09-16-2007, 07:02 AM
  5. stdlib.h system()
    By pktcperlc++java in forum C Programming
    Replies: 8
    Last Post: 01-27-2005, 05:02 PM

Tags for this Thread