_mkdir question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emp
    New Member
    • Nov 2006
    • 32

    _mkdir question

    I'm using gnu c++ on Unix

    I have included direct.h

    My code reads

    int retval=_mkdir(p ath);

    Compiler keeps failing saying _mkdir undeclared(firs t use of this function)

    Any clues as to how to get compiler to recognize _mkdir?

    Thanks

    emp
  • seforo
    New Member
    • Nov 2006
    • 60

    #2
    What is make _mkdir? Or you want to use mkdir command of linux? Then you should consider using the function system()

    Comment

    • emp
      New Member
      • Nov 2006
      • 32

      #3
      Originally posted by seforo
      What is make _mkdir? Or you want to use mkdir command of linux? Then you should consider using the function system()

      I was missing include sys/types.h

      mkdir creates a directory in c/c++ code.

      It compiles now

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        Originally posted by emp
        I was missing include sys/types.h

        mkdir creates a directory in c/c++ code.
        Yes, that's one difference between C and C++. C++ requires function prototypes on all functions excemtp main().

        Comment

        Working...