I'm probably doing something stupid here, but it's been a while since I've worked in C++ and for some reason I keep getting an access violation when sprintf is called. Anyways, here's the code I'm using:
char *value, *result;
int len;
result = "";
mgr.GetObjValue(0, value, len);
for (int i = 0; i < len; i++)
{
sprintf(result, "%s %X", result, value[i]);
}
printf("ObjVal: %s\n\n", result);
if anyone is curious what GetObjValue does, it just retrieves the SNMP object value from the API I am using. Here's it's declaration:
int SNMPMgr::GetObjValue(int iObjIndex, char *&lpObjValue, int &lenObjValue);
Any help would be much appreciated