6/10/2023 0 Comments Null vector example![]() I also read it might happen having realpath returning NULL if the path exceed the maximum allowed in phase of declaration, so I also tried to remove path and feeding NULL, like it was done at as follow: char *ppath = realpath("./. I tried to add a file in the directory above, but doesn't seem to work either, nor with its original path nor with the new one. Then I read about #include, so added this two line and it said "No such file or directory" elseĪfter that I added printf("%s", path) that returned: dir/test, which is the directory above the one I wanted, still ppath is NULL. ![]() It is the resultant of two or more equal vectors that are acting opposite to each other. test/executable but I kept getting -1, checked with gdb and verified that ppath was 0x0. Null vector: A directionless vector whose magnitude is zero is called a null vector. I launched the executable from build directory with. ![]() Where my working directories are as follow dir Searching online I came across realpath here: Īnd followed the example here: Example of realpath function in CĬhar *ppath = realpath("././test/src/file", path ) I wanted a function to return the absolute path given a relative path to an existing file.
0 Comments
Leave a Reply. |