MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / Fruit

Class Fruit

week15/examples/nestedclass.cpp:6–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4{
5public:
6 class Fruit
7 {
8 string name;
9 int weight;
10 public:
11 Fruit(string name="", int weight=0):name(name), weight(weight){}
12 string getInfo(){return name + ", weight " + to_string(weight) + "kg.";}
13 };
14private:
15 Fruit fruit;
16public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected