Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am writing a code where in I have used nested structure. All these structures are defined to be a 64 bit register. Trying to assign a value to these structures as a whole but it is not happening properly. The problem is whole value is not getting assigned. Only a part of it is getting assigned. I have pasted the code here. Please let me know how can I fix it. Thank you in advance.
unsigned long SAR;
struct SARx sar;
struct CHNL_reg ch_reg;
struct dma_reg rst_val;
unsigned long *ptr;
ptr = (unsigned long) &(rst_val.ch_reg.sar);