Initialize POD struct
<pre><code>#include &lt;iostream&gt;

using namespace std;

struct POD
{
    int i;
    char c;
    bool b;
    double d;
};

void Func(POD *p) { ... // change the field of POD }    

void ModifyPOD(POD &amp;pod)
{
    POD tmpPOD = {};
    pod = tmpPOD; // first initialize the pod
    Func(&amp;pod);   // then call an API function that will modify the result of pod
                  // the document of the API says that the pass-in POD must be initialized first.
}

int main()
{
    POD pod;
    ModifyPOD(pod);    

    std::cout &lt;&lt; "pod.i: " &lt;&lt; pod.i;
    std::cout &lt;&lt; ", pod.c: " &lt;&lt; pod.c;
    std::cout &lt;&lt; " , pod.b:" &lt;&lt; pod.b;
    std::cout &lt;&lt; " , pod.d:" &lt;&lt; pod.d &lt;&lt; std::endl;
}
</code></pre>

<p>Question> I need to design a function that modify the pass-in variable <code>pod</code>. Is the above function named as ModifyPOD correct? First, I initialize the struct by assigning it(i.e. pod) with the value from a local struct(i.e. tmpPOD). Then, the variable is passed to Func.
I use the local variable to initialize the pod so that I can avoid to do the following instead:</p>

<pre><code>pod.i = 0;
pod.c = ' ';
pod.b = false;
pod.d = 0.0;
</code></pre>

<p>However, I am not sure whether this practice is legitimate or not.</p>

<p>Thank you</p>
