Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. /* stat.h */
  2. #include <QString>
  3.  
  4. struct stat
  5. {
  6. QString name;
  7. QString array2D[2][4];
  8. }
  9. extern struct stat myStat;
  10.  
  11. /* stat.cpp */
  12. #include <"stat.h">
  13. struct stat myStat = { "Structure 1", { {"one","two","three","four"},{"five","six","seven","eight"} } };
  14.  
  15. /* stat.cpp */
  16. #include <"stat.h">
  17.  
  18. QString myArray[2][4] = { {"one","two","three","four"},{"five","six","seven","eight"} };
  19. struct stat myStat = { "Structure 1", myArray}; // BAD!!
  20. struct stat myStat = { "Structure 1", myArray[][]}; // BAD!!
  21. struct stat myStat = { "Structure 1", &myArray}; // BAD!!
  22.  
  23. /* stat.cpp */
  24. #include <"stat.h">
  25.  
  26. struct stat myStat = { "Structure 1",NULL};
  27. myStat.array2D = { {"one","two","three","four"},{"five","six","seven","eight"} }; // BAD!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement