Hello,
I'm making a program with a structure. I would like to copy SOME of the elements in the structure to another structure, fx if it fulfill some criteria. The program could be something like:
struct vehicles
{
const char *name;
const int year;
};
struct vehicles car[] =
{
{"Mercedes", 2004}, {"BMW", 2002}, {"Mazda", 2004},
{"Fiat", 2001}, {"Toyota", 1999}, {"Passat", 2000},
{"Mitsubishi", 1996}, {"Honda", 1991}, {"Jaguar", 2002} };
lets say that i had another structure like this:
struct newVehilcles
{
const char *name;
const int year;
}newCar[];
and I wanted to copy car[] to newCar[]. How do I do.
Joy..
I'm making a program with a structure. I would like to copy SOME of the elements in the structure to another structure, fx if it fulfill some criteria. The program could be something like:
struct vehicles
{
const char *name;
const int year;
};
struct vehicles car[] =
{
{"Mercedes", 2004}, {"BMW", 2002}, {"Mazda", 2004},
{"Fiat", 2001}, {"Toyota", 1999}, {"Passat", 2000},
{"Mitsubishi", 1996}, {"Honda", 1991}, {"Jaguar", 2002} };
lets say that i had another structure like this:
struct newVehilcles
{
const char *name;
const int year;
}newCar[];
and I wanted to copy car[] to newCar[]. How do I do.
Joy..