#Operator+ returning zero? What am I doing wrong?

16 messages · Page 1 of 1 (latest)

warm ospreyBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

silk elbow
#

the idea is to increase the an object's mArea's value with the other object's and return the object, but you didn't

#
    circleType operator+(const circleType& area) {
        circleType newCircle;
        newCircle.mArea = mArea + area.mArea;
        return newCircle.mArea;
        // do this instead
        // return newCircle;
    }
steep crater
#

I'm getting a weird linker error

#

Severity Code Description Project File Line Suppression State
Error LNK1168 cannot open C:\Users\dnua2\Documents\Visual Studio 2017\Projects\honorsProjectApplication\Debug\honorsProjectApplication.exe for writing honorsProjectApplication C:\Users\dnua2\Documents\Visual Studio 2017\Projects\honorsProjectApplication\honorsProjectApplication\LINK 1

silk elbow
#

your program that you ran previously still running. close the window first to end it.

steep crater
#

oh boi

#

that's embarassing

#

thank you.

#

you knew exactly what it was

silk elbow
#

anwyays, did you get how to do the operator+ ?

steep crater
#

indded, yeah, that made a lot of sense. thank you for walking through that with me! the only thing is im struggling to print out the area of the two circles combined. would you happen to have a clue as to why?

warm ospreyBOT
#

@steep crater Has your question been resolved? If so, run !solved :)

steep crater
#

o my f-ing goodness I FIGURED IT OUT

#

!solved

warm ospreyBOT
#

Thank you and let us know if you have any more questions!