mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Add test program.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
|
||||
struct CoordsData {
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
};
|
||||
|
||||
struct CoordsArray {
|
||||
struct CoordsData* data;
|
||||
int num;
|
||||
};
|
||||
|
||||
int main(void) {
|
||||
|
||||
struct CoordsArray arr;
|
||||
arr.num = 10;
|
||||
arr.data = (CoordsData*)malloc(sizeof(struct CoordsData) * arr.num);
|
||||
|
||||
for (int i = 0; i < arr.num; ++i) {
|
||||
arr.data[i].x = i;
|
||||
arr.data[i].y = i + i;
|
||||
arr.data[i].z = i * i;
|
||||
|
||||
std::cout << i << ") x=" << arr.data[i].x << " y=" << arr.data[i].y << " z=" << arr.data[i].z << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user