Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - getcwd http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   getcwd

   Usage
   #include <direct.h>
   char *getcwd(char *buffer,int length);

   Description
   Returns  the drive letter and path name of the current  directory  and
   stores  it  in  buffer. If buffer  is  NULL,  getcwd()  will  malloc()
   enough  bytes to hold the path including the  terminating 0. At  least
   length bytes will be allocated.

   Example
   #include <direct.h>
   #include <stdio.h>
   main()
   {
   char *buff;
        if((buff = getcwd(NULL,0)) == NULL)
             perror("getcwd error");
        else
             printf("%s",buff);
   }

   Return Value
   Returns   buffer  on success. A return value of  NULL   indicates   an
   error and errno is set to:

   ENOMEM    out of memory.


See Also: chdir mkdir rmdir

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson