Author: Dann Corbit
Date: 16:35:29 04/18/00
Go up one level in this thread
On April 18, 2000 at 17:01:07, John Coffey wrote:
>I am using Borland C/C++ 5.5. If I assign a zero to a structure, will that
>clear the entire structure? i.e. mystruct = 0;
If it is a declaration, then like this:
struct foo zero_struct = {0};
If it is an assignment, then use memset(). However, you should beware. The
language standard does not guarantee the internal format of a pointer to be all
zero bytes for NULL, or that all zero bytes will result in zero floating point
values.
You can also create an "empty" struct like the one called zero_struct, and then
assign with that, and that will work properly. E.g. later on you say:
bar = zero_struct;
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.