I have the question about this codec.

I know sizeof(struct baseball) = 16.
what's the sizeof(Yankees)?

Also,
What will these cout s yield?
cout <<Yankees[2].player;
cout <<Yankees[2].Bbp->player;
cout <<BigPointer+1);

#include <iostream>
using namespace std;

int main()
{
	struct baseball
	{
		char   *Player;
		int    Hrs;
		float  average;
		struct baseball *Bbp;
	};

	struct baseball Yankees[]= {
	"Mantle",     52, .313, Yankees + 1,
	"Maris",      61, .291, Yankees + 2,
	"Richardson", 23, .252, Yankees + 3,
	"Boyer",      18, .301, Yankees + 4,
	"Skowron",    31, .281, NULL},

	*BigPointer = Yankees;
	cout << sizeof(struct baseball);
	cout <<"\n";

	cout << sizeof(Yankees);
	cout << "\n";
}

>>I know sizeof(struct baseball) = 16.

Not necessarily -- that is compiler implementation dependent. Just because one compiler says its 16 doesn't mean it will be the same for all compilers.

The sizeof(Yankeys) is the sizeof(struct baseball) * numer of elements in the Yankeys array. And the number of elements in Yankeys array is calculated like this:

sizeof(Yankeys) / sizeof(Yankeys[0])

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.