Join 75,000+ students acing their exams with Studygenie
Unlimited practice
Flashcards, multiple choice and written questions, as many as you want.
Study sets in seconds
Turn your notes and files into a set with AI.
See your progress
Always know what you've learned and what's left.
Questions in this set (7)
What does typedef do?
allows us to initialize struct object in a shorter way.
example:
instead of having to write 'struct name' whenever we initialize a new struct, we can write
'name ...'
typedef struct name betterName;
What happens when you use = operator to copy array inside a struct vs not?
normally, you can't copy an array by using = operator. However, if array is a member of struct, we can use struct orig = struct copy, to copy array
Difference between . and -> operator?
. operator is used when you have direct instance of that struct.
-> operator is used when you only have a pointer to that struct.
What does malloc do and what does it return?
request allocation of heap memory and returns either null or a pointer where its reserve for your use
What does sizeof do?
tells us how many byte size specified data requires