Question:
I have to do a program on alternating sums using vectors. I am not sure how to start this program. I thought about using an array and every even index add the value and every odd index subtract the value. Does that sound right? Any ideas?
djbsabkcb 0 Junior Poster in Training
Recommended Answers
Jump to Post>Below is my source code but I am getting errors stating invalid conversions.
Post the errors.
Jump to PostThat's a warning, not an error. It's telling you that the constructor expects an unsigned int, but you're passing a double, and there may be a loss of data in the conversion.
Jump to Post>I am not sure what a constructor is with vectors. I know what it is with classes.
Um, vector is a class.>I am still not getting a value for my alternate sum of vectors.
That's because you never place any values in the vector. Compare your code with …
Jump to PostEasily done but you should consider...
- We don't do your homework
- We don't appreciate it when you revive/hijack an old thread
- You really need to read the Daniweb Posting Rules and Suggestions For Posting Questions.
All 16 Replies
Rashakil Fol 978 Super Senior Demiposter Team Colleague
sifuedition 0 Light Poster
shre86 0 Light Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
shre86 0 Light Poster
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
toom toom 0 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
jacklin 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.