Thread: function: strdup()

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    8

    Question function: strdup()

    How many books do you have that don't mention strdup()?

    I can imagine a few... but let me explain what my problem is.

    I don't know what it does! (other than duplicate a string using malloc) I guess I could search my header files and see where it's actually prototyped, but still? Was it just added to the ANSI standard?

    If you know, or want to shed your wisdom on this little lovely I'm all ears.

    Humbly.

  2. #2

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    strdup is not an ANSI-C function.

    Follow the link suggested by shtarker, and check the conformance section of the manual page, and compare that with say strcpy

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    8

    Thumbs up

    Thanks for the responses. I understand it now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM