반응형 SHGetKnownFolderPath2 C++ 사용자 Windows의 경로를 가져오기. SHGetKnownFolderPath() 키워드를 사용하여 원하는 경로를 가져올 수 있습니다. 해당 함수를 사용하려면 해더파일을 참조해야 합니다. 사용법 #include #include using namespace std; int main(void) { PWSTR path = NULL; SHGetKnownFolderPath(FOLDERID_Desktop, 0, NULL, &path); //바탕화면 경로 가져오기. wprintf(L"%s\n", path); CoTaskMemFree(path); SHGetKnownFolderPath(FOLDERID_Documents, 0, NULL, &path); //문서 경로 가져오기. wprintf(L"%s\n", path); CoTaskMemFree(path); ret.. 2020. 6. 4. C++ 파일 입출력(ofstream, ifstream) Window전용 C++에서 파일 입출력할 때 쓰이는 ofstream과 ifstream에 대해 알아보도록 하겠습니다.(Windows) ofstream(output으로 write할 때 쓰임) : http://www.cplusplus.com/reference/fstream/ofstream/ ifstream(input으로 read할 때 쓰임) : http://www.cplusplus.com/reference/fstream/ifstream/ 사용법#include #include #include #include #include using namespace std; string text = "In 1979, Bjarne Stroustrup, a Danish computer scientist, began work on \"C with.. 2020. 6. 4. 이전 1 다음 728x90 반응형