Hi, I am extremely new to c++ this is my first language ever and I need some help
That is what I have but I get an error c2661 'pow' no overload function takes 1 arguments. It is down in sideC = sqrt[(pow(sideOne) + pow(sideTwo))]; What is wrong?
pow takes two parameters, not one. You want to raise sideOne to some power (in this case, presumably using the pythagorean theorem, 2): pow(sideOne, 2) Same goes for sideTwo. In general, pow(x, y) returns x to the yth power. Also, is there any reason you're using single-precision float instead of declaring your variables as double?
Thank you so much! I haven't used a pow() function in a while so I sort of forgot. I was thinking of using double first but I didn't know which would be better
I am 18 and this is my first programming class ever. Is it okay to struggle? I feel so stupid sometimes.
I'm new to programming as well mate and it is difficult as you need to adjust the way you think about problems and in addition you are learning a new language.
I personally think you have your programme properly formatted, which many beginners don't.
Thanks RabMac, my teacher focuses heavy on good coding style. I am taking intro to c++ programming at a CC right now. We go faster than all the other CCs in the area and other areas I believe for this class. Most intro to c++ classes finish at learning to write to/read a file, we do that about the 4th or 5th week so double the pace. It gets overwhelming but I love it. Wish I was amazing at it though
The compile issue may be resolved, but the use of the pow() function here is somewhat of a sledgehammer to crack a walnut. Internally it will probably get the log, multiply by the power and then get the antilog, when all that is required is to multiply a number by itself.