Skip to Content.
Sympa Menu

freetds - [freetds] portable constructions

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] portable constructions
  • Date: Tue, 31 Dec 2002 17:34:28 -0500

I often see code like this:

CS_VOID * buffer;
CS_INT int_val;
memcpy(buffer, &int_val, sizeof(CS_INT));

I wouldn't use memcpy(). I would cast it:

*(CS_INT*) buffer = int_val;

Is there some reason not to do that? Surely my code is easier to
understand and requires fewer instructions.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page