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 -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -