2014-02-15 6 views
0

중첩 구조가 두 개 있습니다.중첩 구조 내의 Memcpy

struct OS_CLASS { 

    PAGE route_table[10]; 

}*sptr_vrf; 

struct PAGE{ 
    int routes; 
} 


struct G-info{ 
    PAGE *displ_table; 
} *global_info 

sptr_vrf-> route_table [0]을 global_info-> displ_table에 복사해야합니다.

memcpy를 사용하여 어떻게 할 수 있습니까?

+0

딥 또는 얕은 복사본을 원하십니까? –

답변

0

memcpy(global_info->displ_table, &sptr_vrf->route_table[0], sizeof(struct PAGE));