
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























int digits[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; char name[10] = {B, e, a, u b, a, d, i, n, e };
int digits[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; char name[10] = {B, e, a, u b, a, d, i, n, e };
int digits[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; char name[10] = {B, e, a, u b, a, d, i, n, e };
Index 0 through 9
int matrix [3][4] = { 0, 1, 2, 3 4, 5, 6, 7 8, 9, 10, 11};
matrix [1][2] = 6 the 5 and 7 are stored in adjacent memory locations (as opposed to the 2 and the 10)
int matrix [3][4] = { 0, 1, 2, 3 4, 5, 6, 7 8, 9, 10, 11};
What is the value of matrix [2][2]?
int matrix [3][4] = { 0, 1, 2, 3 4, 5, 6, 7 8, 9, 10, 11};
What is the value of matrix [2][2]?
10
Richard H. Barnet, Sarah Cox, Larry O'Cull (2006), Embedded C Programming And The Atmel AVR, 13 Delmar Learning, 2 edition
struct structure_tag_name { type variable1; type variable2; : type variableX; };
struct structure_name { type variable1; type variable2; : type variableX; };
struct employee_info { char name[20]; char id[9]; char month; char day; int year; } employee[20];
To access one of the members of the structure you use the member operator “.” So, to access the month of birth for each employee you would write:
employee[x] .month
struct structure_name { type variable1; type variable2; : type variableX; };
struct employee_info { char name[20]; char id[9]; char month; char day; int year; } employee[20];
To access an employee’s id you would write:
employee[x] .id
struct BIRTH { char month; char day; int year; };
struct employee_info { char name[20]; char id[9]; struct BIRTH birthdate; } employee[20];
struct BIRTH { char month; char day; int year; };
To access the 4th^ employee’s year of birth you would write:
employee[3] .birthdate.year
struct employee_info { char name[20]; char id[9]; struct BIRTH birthdate; } employee[20];