Possible duplicate:
How to create a directory tree in C ++ / Linux? Why doesn't mkdir work with tilde (~)?
I am trying to create a directory in a C program and I am using the mkdir function. My program is as follows:
#include <stdio.h> #include <string.h> #define MKDIR(x) mkdir(x) int main() { //If i do mkdir("foo"), the dir is created mkdir("~/test/foo"); //Directory foo not created inside test dir }
dir foo is not created in the test directory.
But how can I achieve this? Thanks in advance
source share