79200440

Date: 2024-11-18 15:09:49
Score: 0.5
Natty:
Report link

Simple:

#include <iostream>
#include <unistd.h>

int main() {
    char *homeDir = getenv("HOME");

    if (homeDir != nullptr) {
        std::cout << "Home directory: " << homeDir << std::endl;
    } else {
        std::cerr << "Error getting home directory." << std::endl;
    }

    return 0;
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Todd Hill