DEV Community

Discussion on: Why doesn't/didn't C have classes?

 
baenencalin profile image
Calin Baenen

Yes, but it would just be a different way of writing the same thing.
Wouldn't it be easier to write:

class Test {
    int num = 1;
}
Enter fullscreen mode Exit fullscreen mode

instead of:

struct Test {
    int num = 1;
}
typedef struct Test Test;
Enter fullscreen mode Exit fullscreen mode

?