Skip to main content
edited tags
Link
justin
  • 104.8k
  • 14
  • 185
  • 227
deleted 2 characters in body
Source Link
ildjarn
  • 63.2k
  • 9
  • 133
  • 219

I have a struct, player, which is as follows:

struct player() {
string name;
int rating;
};

I'd like to modify it such that I declare the struct with two arguments:

player(string, int)

it assigns the struct's contents with those values.

I have a struct, player, which is as follows:

struct player() {
string name;
int rating;
};

I'd like to modify it such that I declare the struct with two arguments:

player(string, int)

it assigns the struct's contents with those values.

I have a struct, player, which is as follows:

struct player {
string name;
int rating;
};

I'd like to modify it such that I declare the struct with two arguments:

player(string, int)

it assigns the struct's contents with those values.

Source Link
Michael Hang
  • 199
  • 2
  • 3
  • 15

Struct Initialization Arguments

I have a struct, player, which is as follows:

struct player() {
string name;
int rating;
};

I'd like to modify it such that I declare the struct with two arguments:

player(string, int)

it assigns the struct's contents with those values.