Try this:
int test = 2;
snmp_pdu_add_variable(pdu, oid, oid_length, ASN_INTEGER, reinterpret_cast<u_char*>(&test), sizeof(test));
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"