Assign one struct to another in C -


can assign 1 instance of struct another, so:

struct test t1; struct test t2; t2 = t1; 

i have seen work simple structures, bu work complex structures?
how compiler know how copy data items depending on type, i.e. differentiating between int , string?

yes if structure of same type. think memory copy.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -