<p>I am writing a C program in Linux.  Commands like execv() require a path in the form of a C string.  Is there a command that will return the current path in the form of a C-style string?</p>

getcwd()
:
SYNOPSIS
```
```
#include <unistd.h>

char *getcwd(char *buf, size_t size);
```
```
DESCRIPTION
The
getcwd()
function shall place an absolute pathname of the current working directory in the array pointed to by
buf, and return buf
. The pathname copied to the array shall contain no components that are symbolic links. The
size
argument is the size in bytes of the character array pointed to by the
buf
argument. If
buf
is a null pointer, the behavior of getcwd() is unspecified.
RETURN VALUE
Upon successful completion,
getcwd()
shall return the
buf
argument. Otherwise,
getcwd()
shall return a null pointer and set
errno
to indicate the error. The contents of the array pointed to by
buf
are then undefined....