XPLM_API void       XPLMGetPrefsPath(
                         char *               outPrefsPath);    

This routine returns a full path to a file that is within X-Plane’s preferences directory. (You should remove the file name back to the last directory separator to get the preferences directory using XPLMExtractFileAndPath.)

The buffer you pass should be at least 512 characters long. The path is returned using the current native or OS path conventions.