Re: Initializing record variables
Posted in 1995
In <whudace.793990565@bgsuvax> whudace@bgsuvax.bgsu.edu (Bill Hudacek) writes: > >johnl@informix.com (Jonathan Leffler) writes: > >>}From: Gabriel Beccar-varela <gabriel@ccnet.com> >>}Date: 26 Feb 1995 13:25:21 GMT >>}X-Informix-List-Id: <news.11821> >>} >>}jcarr@coredump.vr.net ("Jim Carr") wrote: >>} >>}> Does anyone know of a quick way to initialize every element of this >>}> record to "N"? >>} >>} Try initialize blah.* to 'N'. I know it works when you initialize to NULL. I am not >>}sure to any other value. > >>This won't work. > >>There isn't any really convenient way to do it. > >>Aside: how would you do it (cleanly) in C? > > >memset( record, (int) 'N', sizeof(record) ); > >>Yours, >>Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >-- > >William G. Hudacek Internet: whudace@dad.bgsu.edu >University Computer Services Bowling Green State University > This doesn't quite get it done. If you have a char[12] in the C structure, you would end up with "NNNNNNNNNNNN" with no trailing null-- yuck!!. John Prideaux alastl@ix.netcom.com