goth_nerd
Expert Member
Hi guys
So I need some help, let's say I have a struct called "Customer" and let's say it looked like this:
When populated the firstname is 10 characters long, I need to find the size of firstname. When I use sizeof(firstname) it brings back the size as 20 and not 10. Can someone explain this to me, I am very confused.
Thanks.
So I need some help, let's say I have a struct called "Customer" and let's say it looked like this:
Code:
struct Customer
{
char FirstName[20];
char Surname[20];
char ID[15];
char Country[50];
}
When populated the firstname is 10 characters long, I need to find the size of firstname. When I use sizeof(firstname) it brings back the size as 20 and not 10. Can someone explain this to me, I am very confused.
Thanks.