Answers for "can a struct contain a struct c++"

C
1

how to put a struct in another struct C

struct B {  // <-- declare before
  int number;
};
struct A {
 int data;
 B b; // <--- declare data member of `B`
 };
Posted by: Guest on May-08-2020
2

struct c++

struct product {
  int weight;
  double price;
} apple, banana, melon;
Posted by: Guest on November-29-2020

Code answers related to "C"

Browse Popular Code Answers by Language