function: strdup()

This is a discussion on function: strdup() within the C Programming forums, part of the General Programming Boards category; How many books do you have that don't mention strdup()? I can imagine a few... but let me explain what ...

  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
    Registered User
    Join Date
    Jan 2002
    Posts
    381

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,767
    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, 02:01 AM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 07:54 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 12:45 PM
  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

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