Sponsored Content
Full Discussion: C++ to C
Top Forums Programming C++ to C Post 302397367 by Corona688 on Monday 22nd of February 2010 01:46:27 AM
Old 02-22-2010
As usual, I can't see your code from here so can't tell why it's segmentation faulting. if I had to guess, I'd guess you were feeding integers into crc_add instead of pointers to integers.

Code:
// For integers, objects, etc 
crc_add(&crc, &object, sizeof(object));
// for arrays
crc_add(&crc, array, sizeof(array));
// for a pointer
crc_add(&crc, pointer, sizeof(*pointer));
// for a string
crc_add(&crc, string, strlen(string));

This is all from basic understanding of pointers in the C language.
 
All times are GMT -4. The time now is 04:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy