Q:

fprintf for heterogeneous struct

Is there a simple way to concatenate all of the fprintf(qFile, "%-1.1c", mod[cnt].name[x]); expressions into a small number of expressions?
Appreciate any other suggestions.
    #include "stdafx.h"
    #include <stdio.h>
    #include <iostream>

    // fprintfQuestion.cpp : Defines the entry point for the console application.
    // add _CRT_SECURE_NO_DEPRECATE  to Properties \ C\C++ \ Preprocessor \  Preprocessor Definitions

    struct mod
    {
        char    name[32];
        int     dateStart;
        int     dateEnd;
    };

The struct mod is an abbreviated version of the struct used in a GUI editor for the game for which I'm an apprentice developer. The full struct includes about 20 variables. Objects from this struct correspond to "script modules" used by the game's computer-opponent, and which can be randomly or statically assigned to specific scenarios in the game by scenario designers.
The goal of the exercise I'm engaged in at present is to develop a "loader" application that can transfer data between the .dat files the editor works with and .csv files that humans can manipulate in spreadsheets. Most of the scenario designers are not programmers.
    int main()
    {
        FILE     *pFile, *qFile;
        int      cnt = 0, n = 0;
        char     str[40]; //1328
        mod      mod[3]; //2000
        long     bytes = 1328; // first record of 0 to 1327 is blank

    pFile = fopen("W:\\User\\dir\\sourcefile.dat", "rb");
    qFile = fopen("W:\\User\\dir\\targetfile.csv", "a");

    for (cnt = 0; cnt < 3; cnt++)
       {
        fseek(pFile, bytes, SEEK_SET);
          for (n = 0; n < 40; n++)
             {
               str[n] = getc(pFile);
             };
          memmove(mod+cnt, str, 40);
          fprintf(qFile, "%-1.1c", mod[cnt].name[0]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[1]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[2]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[3]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[4]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[5]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[6]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[7]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[8]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[9]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[10]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[11]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[12]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[13]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[14]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[15]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[16]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[17]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[18]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[19]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[20]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[21]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[22]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[23]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[24]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[25]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[26]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[27]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[28]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[29]);
          fprintf(qFile, "%-1.1c", mod[cnt].name[30]);
          fprintf(qFile, "%-1.1c,", mod[cnt].name[31]);
          fprintf(qFile, "%.6i,", mod[cnt].dateStart);
          fprintf(qFile, "%.6i,", mod[cnt].dateEnd);
          fprintf(qFile,"\n");
          bytes = (bytes + 1328);
    };

    fclose(pFile);
    fclose(qFile);
    std::cout << "Type any key to quit. \n";
    std::cin.get();
    return 0;
}

As far as I know, there are no null-terminated records in the data; my examination of the .dat files with HexEdit does not suggest as much to me.
A typical row of output in the .csv that this code generates might be:

Attack Orleans Rgt,281012,291228

Corresponding to the name of the script, the date it can start (12 Oct 1428) and the date it can end (28 Dec 1429).

A:

Merge all fprintf()s into a single one
You could try merging all of your fprintf() calls into this single call:
fprintf(qFile, "%.32s,%.6i,%.6i,\n", mod[cnt].name, mod[cnt].dateStart,
        mod[cnt].dateEnd);

The %.32s specifier means "print a string up to 32 characters long".  From the example output you showed in the comments, I think that this would work for you.  If you don't need a trailing comma at the end of the line, you could remove it.  (Your code had it there but your example didn't so I left it in).
Use fread()
Instead of this loop and memmove():
    for (n = 0; n < 40; n++)
         {
           str[n] = getc(pFile);
         };
    memmove(mod+cnt, str, 40);

You could use one call to fread:
    fread(&mod[cnt], 1, sizeof(mod[cnt]), pFile);

You might want to static_assert that sizeof(struct mod) == 40 somewhere, since your code seems to depend on that.

