Created
June 23, 2017 02:07
-
-
Save jrziviani/82946e66599735ec6dcab5f0e8be3ec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
#include <cstdint> | |
using namespace std; | |
struct x | |
{ | |
int32_t xa; | |
unique_ptr<double[]> xb; | |
x(int32_t i) : | |
xa(i), | |
xb(unique_ptr<double[]>(new double[i])) {} | |
}; | |
int main() { | |
x lines[10](5); | |
for (size_t i = 0; i < 10; ++i) { | |
for (size_t j = 0; j < 5; ++j) { | |
lines[i].xb[j] = 10.5; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment