Tesla interview question

How do you access values of a struct using pointers?

Interview Answer

Anonymous

1 Oct 2019

Using "this" operator. -> For example, struct page{ uint8_t byte1; uint8_t byte2; uint8_t byte3; uint8_t byte4; }; int main(void) { struct page *ptr, page1; ptr = &page1; printf("%d,%d", ptr->byte1, ptr->byte2); }

2