hey i was wondering if there's any way that can set they value of an
array of structs the way I tried to do below for ray[1]. That code on that
line kills everything but I didn't want to have to create a demo object then assign
it as i did for ray[0]. Anyway around this? or do i have 2 always create an object first?
Thanx
Code:
#include<iostream>
using namespace std;
struct demo {
int val;
int vol;
int vel;
};
int main() {
demo dem = {1,2,3};
demo ray[5];
ray[0] = dem; //This works
ray[1] = demo{3,2,1}; //This kills the program
}