int myArray[4]
int myArray = {1,2,3,4}
MyArray [4] can simply access the fifth element of the array, and it can be used as either a lvalue or a rvalue.Example:
1
2
3
4
5
6
7
8
int sumArray(int * array, int n){
int answer = 0;
int * ptr = array;
for(int i = 0; i<n; i++){
answer += *ptr;
ptr++;
}
}
int myFunction{int * myArray, int size};int myFunction{int myArray[], int size};Definition:
Struct can define a structure type, it does not create instances of the struct. We apply the same way to declare variables in struct as in other places.
Example
1
2
3
4
5
typedef struct book_t {
char author[50];
char title[10];
int32_t edition;
}book;
sizeof (structA) evaluates to the number of bytes occupied by the variable structAtypedef <base type> <list of types>;. is the field access operator that can help to access the fields defined in the structure.struct book_t bookA—> operator to access fields after dereferencing—> can dereference and access a field. (*s).top = s->top
enum {FALSE, TRUE} FALSE has value 0 and TRUE has value1