Need to edge out the competition for your dream job? Train for certifications today.
This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.
the Client will pass that number of bytes in one big byte array and the Server will decode that array based on the number of bytes they've both agreed to. . . . . .am I close?
#define MAX_RECORDS 10
int some_c_function(unsigned char * buffer, unsigned int sizbuffer)
typedef struct tag_mystruct
} MYSTRUCT, *PMYSTRUCT;
PMYSTRUCT pMyArr = NULL;
/* check that the passed size is the required size */
assert(sizbuffer == (sizeof(MYSTRUCT) * MAX_RECORDS));
/* cast the argument buffer */
pMyArr = (PMYSTRUCT)buffer;
memset(pMyArr, 0, (sizeof(MYSTRUCT) * MAX_RECORDS);
/* from here you could use pMyArr same as a variable MYSTRUCT myArr[MAX_RECORDS]; */
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.