본문 바로가기

공부하며놀자/프로그래밍40

[C++] std::string to LPCWSTR http://stackoverflow.com/questions/27220/how-to-convert-stdstring-to-lpcwstr-in-c-unicode std::wstring s2ws(const std::string& s) { int len; int slength = (int)s.length() + 1; len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); wchar_t* buf = new wchar_t[len]; MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len); std::wstring r(buf); delete[] buf; return r; } std::wstring ste.. 2015. 11. 19.
c++ CString to std::string, std::string to CString 문자열 변환 ref : http://egloos.zum.com/merino/v/10903111. CString -> std::string CString str = "hello"; std::string stdStr = str.GetBuffer(0); 2. std::string -> CString std::string stdStr = "hello"; CString str = stdStr.c_str(); 2015. 11. 18.
javascript 자바스크립트 object to array how to make an array out of object.how to make obect to an array.오브젝트로 배열 만들기오브젝트로 어레이 만들기 myArr = Array.prototype.slice.apply(myObj); 한줄이면 깔끔하게 해결!! 굳!! http://stackoverflow.com/questions/6857468/a-better-way-to-convert-js-object-to-array에서 bjornd가 쓴 코멘트. 2015. 8. 5.
폴더 안의 모든 파일 목록 가져오기 get list of files in a directory http://stackoverflow.com/questions/612097/how-can-i-get-the-list-of-files-in-a-directory-using-c-or-c folder에 경로만 넣어주면 됨. 굳굳#include vector get_all_files_names_within_folder(string folder) { vector names; char search_path[200]; sprintf(search_path, "%s*.*", folder.c_str()); WIN32_FIND_DATA fd; HANDLE hFind = ::FindFirstFile(search_path, &fd); if(hFind != INVALID_HANDLE_VALUE) { do { // read all .. 2015. 7. 15.
반응형