How can I initialize this struct array using a pointer? I try to read input into the struct variables and I get garbage output, but when I initialize a static array I output the correct variables.
unsigned int data = numberOfLines();
patient *q; //struct pointer
q = new patient[data];
//What I want to do
q = new patient[data] = {0,0,0,0,0}; // initialize the array
new[]
anddelete[]
, you should switch tostd::vector
that someone else has already debugged. – Ben Voigt yesterdaypatient
structs? – birryree yesterday