Hello, I'm having trouble figuring out how to find the size of an array program that involves "struct."
#include <iostream>
using namespace std;
struct d{
char* a;
float b;
int c;
};
int main(){
d array[5];
cout<<sizeof(array)<<endl;
return 0;
}
When I run this program, the output is 80(for my compiler). That would mean that each element in the array is 16 bytes but I don't understand how struct d is 16 bytes.