Guest User

Untitled

a guest
Sep 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. char str[33][40];
  2. CreateCSV((char**)str);
  3.  
  4. void CreateCSV(char** str)
  5. {
  6. char strData[]= {'"','Д','А','Т','А','"',';',''};
  7.  
  8. if(str[0x00] != NULL)
  9. strcpy (str[0x00], strData);
  10. else
  11. Console("СтрокаЗаголовка[0x00] == NULL");
  12. }
  13.  
  14. int main() {
  15. long a[10][10];
  16. for (int i=0;i<10;i++)
  17. for (int j=0;j<10;j++)
  18. a[i][j] = -10000 - i*100 - j;
  19. cout << (long)a<<endl;
  20. cout << (long)a[0]<<" "<<(long)a[1]<<" "<<(long)a[9]<<endl;
  21. int **b = (int **)a;
  22. cout << (long)b<<endl;
  23. cout << (long)b[0]<<" "<<(long)b[1]<<" "<<(long)b[9]<<endl;
  24. return 0;
  25. }
  26.  
  27. 140727855538752
  28. 140727855538752 140727855538832 140727855539472
  29. 140727855538752
  30. -10000 -10001 -10009
  31.  
  32. [0,0][0,1]...[0,9][1,0][1,1]...[1,9]...[9,0][9,1]...[9,9]
  33.  
  34. b --> [0][1]...[9]
  35. b[0] --> [0][1]...[9]
  36. b[1] --> [0][1]...[9]
  37. ...
  38. b[9] --> [0][1]...[9]
  39.  
  40. #include <stdio.h>
  41. #include <string.h>
  42.  
  43. void CreateCSV(char str[33][40])
  44. {
  45. char strData[33][40]= {""","D","A","T","A",""",";",""};
  46.  
  47. if(str != NULL)
  48. memcpy (str, strData, sizeof(strData));
  49. else
  50. printf ("errorn");
  51. }
  52.  
  53. int main (void)
  54. {
  55. char str[33][40] = {''};
  56. int i=0;
  57.  
  58. CreateCSV(str);
  59.  
  60. for (i=0; i<33; i++)
  61. printf ("%sn", str[i]);
  62.  
  63. return 0;
  64. }
  65.  
  66. char str[33][40];
  67.  
  68. char str**;
  69.  
  70. #include <stdio.h>
  71. #include <string.h>
  72.  
  73. void CreateCSV(char str[33][40])
  74. {
  75. char *strData[33] = {""","D","A","T","A",""",";",""};
  76.  
  77. if(str != NULL)
  78. {
  79. int i=0;
  80. for (i=0; i<33; i++)
  81. if (strData[i] != NULL)
  82. strncpy (str[i], strData[i], 40);
  83. }
  84. else
  85. printf ("errorn");
  86. }
  87.  
  88. int main (void)
  89. {
  90. char str[33][40] = {''};
  91. int i=0;
  92. CreateCSV(str);
  93. for (i=0; i<33; i++)
  94. printf ("%sn", str[i]);
  95. return 0;
  96. }
Add Comment
Please, Sign In to add comment