[LC++]Size of structure pointer/array

Paul M Foster paulf at quillandmouse.com
Thu Aug 30 11:30:07 UTC 2001


Assuming:

//////////////////////

struct int_struct {
	int a;
	int b;
	int c;
};

void is_func(int_struct *i); // defined elsewhere

int_struct is[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};

is_func(is);
	
////////////////////

When I pass "is" to the is_func() function, am I passing the whole array
of structures, just a pointer to the first element, or what? The size of
"is", when passed to the function (and measured inside the function) is
the size of a pointer. But I'm concerned that I've passed more than that
on the stack.

Paul




More information about the tuxCPProgramming mailing list