Sorry to put a post up about something so simple, but I don't see what I'm doing wrong here.
char data[1024];
DWORD numRead;
ReadFile(handle, data, 1024, &numRead, NULL);
if (numRead > 0)
printf(data, "%.5s");
My intention with the above is to read data from a file, and then only print out 5 characters. However, it prints out all 1024 characters, which is contrary to what I'm reading here. The goal, of course, is to do something like:
printf(data, "%.*s", numRead);
What am I doing wrong here?