Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

array of struct in C++

struct Car
{
	string name;
}

Car * car = nullptr;
int count = 100;

car = new Car[count];

for (int i = 0; i < count; i++)
{
	car[i].name = "car" + i;
}

 
PREVIOUS NEXT
Tagged: #array #struct
ADD COMMENT
Topic
Name
6+8 =