Skip to Content.
Sympa Menu

freetds - [freetds] cast to void?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] cast to void?
  • Date: Mon, 3 Dec 2007 19:19:23 -0500

Hi Freddy!

memset((void*)pnullrep->bindval, ' ', bindlen);

Why the cast? The first argument to memset is a void*. There's no need to
cast it. In C, any data pointer can be assigned to a void pointer, and a
void pointer can be assigned to any data pointer. That's why void* was
invented!

http://www.lysator.liu.se/c/rat/c2.html
http://www.opengroup.org/onlinepubs/000095399/functions/memset.html

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page