H4x0

Get Current Directory

May 8th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.17 KB | None | 0 0
  1. char* currentDirectory() {
  2.     char* buffer;
  3.  
  4.     if((buffer = _getcwd(NULL, 0)) == NULL) {
  5.         perror("Unable to find current directory");
  6.     } else {
  7.       return buffer;
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment