Gokulakannan Somasundaram wrote: >> Another possibility, if you want to keep the per-member initialisation: >> what about using 0 as an initialiser rather than NULL? If I'm remembering >> the C rules properly (though things are slightly different in C++), 0 is a >> valid initialiser for every scalar type (integer, floating-point, pointer, >> enum) -- unlike NULL, which is specifically typed to be a pointer. > > Assigning it to 0, will again cause trouble for C++ folks.
No it won't, because 0 is a valid (indeed, the preferred) way of writing a null pointer constant in C++. It's actually the other way round -- 0 is not *necessarily* a valid null pointer constant in C, although it will work as such (but might produce a warning) in almost all common C implementations. -- David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com
signature.asc
Description: OpenPGP digital signature
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
