Does C have classes?

No, C doesn’t have classes. That said, there are ways of simulating object-oriented programming in C – a quick Google search should yield some useful results.

incompatible types: void cannot be converted to int [duplicate]

Your program does not have to return an int in public static int main. Instead you can have it as void (meaning don’t return anything). You should simply just print your statements and don’t return them. Also the int[] should be String[] and Scanner should check for nextInt() as pointed out in comments!

How do you implement a class in C?

That depends on the exact “object-oriented” feature-set you want to have. If you need stuff like overloading and/or virtual methods, you probably need to include function pointers in structures: This would let you implement a class, by “inheriting” the base class, and implementing a suitable function: This of course requires you to also implement a … Read more

‘namespace’ but is used like a ‘type’

I suspect you’ve got the same problem at least twice. Here: … you’re declaring a type with the same name as the namespace it’s in. Don’t do that. Now you apparently have the same problem with Time2. I suspect if you add: to your list of using directives, your code will compile. But please, please, … Read more

What is predicate in C++?

A predicate is a C++ function returning a boolean or an object having a bool operator() member. A unary predicate takes one argument, a binary takes two, and so on. Examples of questions predicates can answer for a particular algorithm are: Is this element what we are looking for? Is the first of two arguments … Read more

Node cannot be resolved to a type

I’ve seen similar behaviour in the past and know of two possible reasons: Your build path has somehow changed, leaving out your Node class, or the project providing it has compile errors, or similar. Given your description of the problem, this probably isn’t relevant in your case. Some Eclipse screwup. For me, this was always … Read more

Pass arguments to Constructor in VBA

Here’s a little trick I’m using lately and brings good results. I would like to share with those who have to fight often with VBA. 1.- Implement a public initiation subroutine in each of your custom classes. I call it InitiateProperties throughout all my classes. This method has to accept the arguments you would like … Read more