visual studio 2010 - Listing all files in a folder, only first character of file name gets printed -


this question has answer here:

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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -