I'm struggeling about with the typecast of one struct into another.

I want to do something like this:

Qt Code:
  1. struct myFirstStruct
  2. {
  3. unsigned char c1;
  4. unsigned char c2;
  5. unsigned char c3;
  6. unsigned char c4;
  7. unsigned char c5;
  8. unsigned char carray1[6];
  9. };
  10.  
  11. struct mySecondStruct
  12. {
  13. unsigned char carray1[4];
  14. unsigned char c1;
  15. unsigned char carray2[6];
  16. };
  17.  
  18. ...
  19.  
  20. myFirstStruct s1;
  21. mySecondStruct s2;
  22.  
  23. s1 = (myFirstStruct)s2;
To copy to clipboard, switch view to plain text mode 

As you can see, both arrays are of equal size.

But I always get an error, that this conversion can't be done.
How can I do this?