How do you print a limited number of characters?
- by Mike Pateras
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…