C/C++ hackerrank question

Sep 28, 2021 at 11:23am
Hi!

I have hackerrank for sorting out problems but it’s instructing C stuff in c++ stuff, I have an idea about C it can operate with C++ and from C c++ came, but don’t know much about it and due to this I have been stuck in an error.

The error that I am facing is in the scan "Invalid operands to binary expression ('int *' and 'long')"

I am not getting the error. Please suggest me the solution.

Thanks
Last edited on Sep 28, 2021 at 11:24am
Sep 28, 2021 at 11:40am
Ariachloe wrote:
The error that I am facing is in the scan "Invalid operands to binary expression ('int *' and 'long')"

One of your arguments is (incorrectly) a pointer or memory address.




The error that I am facing
I am not getting the error.

I think you need to make up your mind.



Show your code if you want help.
Last edited on Sep 28, 2021 at 11:40am
Sep 28, 2021 at 11:59am
heh "i am not getting the error" means he didn't understand the message -- "I don't get it" style.

Yes, C++ can handle a LOT (not all, but a lot) of C code without changes. C++ usually has a better way to do what C does, and there is no reason to mix the two. A small # of things C++ can't do as well. Try to use C++ unless you can show that the C++ is notably slower or can't do the job.
Topic archived. No new replies allowed.