I was looking for a way to use C++ class in C code. I came across this C++ library in c. Going through the write noticed a method where class definition is declared as struct. I even confirmed it with below code offline.
#include <iostream>
using namespace std;
class shyam
{
int a;
};
int main()
{
struct shyam obj;
return 0;
}
here we can see that class type shyam can be used to declare a structure obj of type shyam. I want to why this behavior exists and what are the potential use cases for it ?
Thank You !