How to resolve relative path to absolute path in C?

I have a C console application where I need to output the absolute path to the file taking into account the (possibly) relative path. What is the best way to do this in C on a Windows environment?

+6
source share
2 answers

I think you are looking for _ fullpath () .

+8
source

GetFullPathName should help you on Windows.

GetFullPathName combines the name of the current drive and directory with the specified file name to determine the full path and file name of the specified file.

+3
source

Source: https://habr.com/ru/post/902918/


All Articles