Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i have this info[35] can conntain 3

Status
Not open for further replies.

vintl

Technical User
Jun 9, 2000
72
0
0
MY
i have this info[35] can conntain 35 bytes, but now i only wan to extract the last 5 bytes and push it into DB, is this stmt correct?
start from byte ->30, and read only 5 byte.

memcpy(dorgnins_db.info, info[30], 5 );
 
memcpy() expects an address for the first and second arguments. Try this:

Code:
memcpy( dorgnins_db.info, info + 30, 5 );

On a another note, the info array contains 35 elements. This means the first element is number zero (info[0]), and the last element is 34 (info[34]). If you wanted to access the 30th element of the array using a subscript, you would reference it as info[29].


Cheers,
Jason Deckard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top