The default access level for classes is private. Change it to public:
class a {
public:
int count;
};
Or change it to a struct whose default access level is public:
struct a {
int count;
};
Do the same for class b.
More Related Contents:
- CPP- I am getting Segmentation fault (core dumped)?
- Putting multiple calculations into a for-loop that uses variables based on iteration number
- Assign value to array of pointers
- The array index doesnt show the character [closed]
- Inheritance. Why this output?
- Why doesn’t polymorphism work without pointers/references?
- Why use static_cast(x) instead of (int)x?
- Benefits of inline functions in C++?
- Significance of ios_base::sync_with_stdio(false); cin.tie(NULL);
- Determine the line of code that causes a segmentation fault?
- Should I use std::function or a function pointer in C++?
- Is constexpr supported with lambda functions / expressions?
- How to create a static library with g++?
- Scope of variables in if statements
- Simple object detection using OpenCV and machine learning
- Why are string literals const?
- C++: Converting Hexadecimal to Decimal
- C++ new operator thread safety in linux and gcc 4
- Argument of type “char *” is incompatible with parameter of type “LPWSTR”
- Uninitialized pointers in code
- OpenMP set_num_threads() is not working
- Counting the number of occurrences of a string within a string
- Why is iterating though `std::vector` faster than iterating though `std::array`?
- std::lexical_cast – is there such a thing?
- C++ Multi-line comments using backslash
- How to determine programmatically if an expression is rvalue or lvalue in C++?
- Can you start a class name with a numeric digit?
- QT QWebEnginePage::setWebChannel() transport object
- narrowing conversion from unsigned to double
- How can I cin and cout some unicode text?