visual studio 2010 - Listing all files in a folder, only first character of file name gets printed -
this question has answer here:
- filenames truncate show first character 3 answers
i'm trying access images in designated folder, names, , pass them further processing (getting pixel values, precise, isn't relevant now). following test code should list name of every image found, however, reason lists first letter each image.
#include <windows.h> int main(int argc, char* argv[]) { win32_find_data search_data; memset(&search_data, 0, sizeof(win32_find_data)); handle handle = findfirstfile(l"images\\*.jpg", &search_data); while(handle != invalid_handle_value) { printf("found file: %s\r\n", search_data.cfilename); if(findnextfile(handle, &search_data) == false) break; } return 0; }
your program compiled unicode, printf format string expecting ascii string. change %s %s.
Comments
Post a Comment