getcwd

Syntax

string getcwd(string buffer, int maxlen)

Arguments

buffer
A pointer to a string (character buffer) where the result should be stored.
maxlen
The maximum length of the path that can be stored in the given character buffer.

Return

Returns a string (pointer to a character buffer) if successful, NULL if there was an error.

Description

Returns the current working directory.

Example

Also see

mkdir, chdir, rmdir

Comments

Everyone can add their comments about their experiences with this function here. Tips for using it are welcome, too.