How to write a C Program to Get Current Directory PWD ?
Solution:
#include <unistd.h>
#include <stdio.h>
int main() {
char cwd[1024];
chdir("/path/to/change/directory/to");
getcwd(cwd, sizeof(cwd));
printf("Current working dir: %s\n", cwd);
}
Learn To Write A Program. Learn Programming Online. Find Programming Solutions.