strdup--> standard function or not?

This is a discussion on strdup--> standard function or not? within the C Programming forums, part of the General Programming Boards category; I found this old thread, where it says that one has the strdup defined in stdlib.h instead of the string.h ...

  1. #1
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694

    strdup--> standard function or not?

    I found this old thread, where it says that one has the strdup defined in stdlib.h instead of the string.h , because it is not standard C.
    http://cboard.cprogramming.com/c-pro...on-strdup.html

    I found this link for string.h ,where strdup is part of it
    <string.h>

    I looked in another forum with good documentation,and it does not have it
    cstring (string.h) - C++ Reference

    So,is it standard or not?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,820
    It's part of some standards, just not the ISO C standard.
    strdup(3): duplicate string - Linux man page

    See the "Conforming To" section.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strdup function is eating a letter
    By DeanWinchester in forum C Programming
    Replies: 15
    Last Post: 05-31-2012, 09:06 AM
  2. Is there a standard function?
    By frktons in forum C Programming
    Replies: 223
    Last Post: 07-16-2010, 04:31 PM
  3. Is there a standard C function to do this?
    By lucidrave in forum C Programming
    Replies: 9
    Last Post: 08-15-2009, 12:21 AM
  4. Replies: 15
    Last Post: 11-11-2007, 10:40 AM
  5. function: strdup()
    By cjtotheg in forum C Programming
    Replies: 3
    Last Post: 02-02-2002, 10:08 AM

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