Talk:TUT:Simple Async Application

From Net-SNMP Wiki
Revision as of 14:56, 1 March 2010 by Wes (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Is it bug??

/*
  * a list of variables to query for
  */
 struct oid {
   char *Name;
   oid Oid[MAX_OID_LEN];
   int OidLen;
 } oids[] = {
   { "system.sysDescr.0" },
   { "interfaces.ifNumber.1" },
   { "interfaces.ifNumber.0" },
   { NULL }
 };

The name of the structure and the type of the second field have the same names. Is it possible??

Nope... That's legal C because the structure, when used, would need to be prefixed with "struct" to work. It couldn't be a typedef, however, because in fact 'oid' is already a typedef.