Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The second code you show,</p> <pre><code>WINDOWPLACEMENT wplcmt; memset(&amp;wplcmt, 0, sizeof(WINDOWPLACEMENT)); wplcmt.length = sizeof(WINDOWPLACEMENT); </code></pre> <p>is beyond horrible. Obfuscation, inefficiency, verbosity, you crammed it all into that.</p> <p>The first code snippet,</p> <pre><code>WINDOWPLACEMENT wplcmt = {sizeof(WINDOWPLACEMENT)}; </code></pre> <p>is, except for the obfuscation, the preferred way, unless you want to</p> <ul> <li><p>spend more time needlessly writing more code,</p></li> <li><p>have readers spending more time reading and needlessly analyzing your verbose code,</p></li> <li><p>get less efficient execution, and</p></li> <li><p>provide bug entry portals.</p></li> </ul> <p>By the way, what's with the obfuscated name you used, <code>wplcmt</code>?</p> <p>Why are you obfuscating names?</p> <p>Is your question real or is it simply trolling?</p> <p>Cheers &amp; hth.,</p> <p><strong>EDIT</strong>: the question has been edited. The above questions were in response to the original title/question, "How evil is this structure allocation?". I'm leaving my answer as-is to provide context for the comments.</p> <p><strong>EDIT 2</strong>: the context has changed even further: the OP's nick changed from "Madman" to "Coder". So, while the original was about "How eveil is" normal code by "Madman", it's now about "Is it preferred..." by "Coder". Oh well, I mean, I'm not calling him "Madman" in the commentary, as it would appear now; it's what he called himself, his nick at the time.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload