I fixed my problem, thanks everyone for your patience and help.
Type: Posts; User: StarOrbs
I fixed my problem, thanks everyone for your patience and help.
My copy paste technique is fine thank you very much... I'm using g++... I've been messing around with that program and all it ever does it output 0. It's like it never gets to int main()
because...
I know how to do rationals, my problem is with the actually code. I've been messing around with everyone's suggestions and ideas. Still no luck.
Let me post the code, maybe you guys will see where I'm going wrong. Don't worry about the rest of the code, I just need help with the operators.. += and such
#include <sstream>
`
class...
I understand what your typed but all that program does it ouput 0 to the screen. This is driving me nuts.
I tried to figure out what you mean but it won't let me multiply something that is part of an object by an integer.
I got the += working but for some reason when I got to *= I got snagged again. I'm trying to multiply, I'll just use your example.. x times a integer.. For example..
x * 8 ..
And in the .cxx file...
Silly me, thanks for that I realized one of my problems. I have to take the numerator of lhs and rhs and add the two. Now I just have to figure out how to do that. Any ideas? lol
I'm still new to this so I haven't really figured out what to use yet, I mean to type int though.
I have a main file rational.cxx and a header file rational.h.
Everything seems to be working except i can't get the +=, *=, -=, and /= operators to work in the rational.cxx file.
I have a function...
I finally got rid of all the errors now that I know how everything works. I've been sitting here for 15 minutes trying to figure out why it isn't ouputting anything and I realized I had return 0 on...
I believe I have that.. I updated the code a bit, and I got rid of that one error but now I have another..
ERROR:
array.cxx: In function `int main()':
array.cxx:30: error: could not convert...
I've been having trouble trying how to figure out to ouput the information and this is how one of the examples had it.
The output function is used to output the first set of information, the member...
Geez, I can't believe I forgot that, but either way I still get the same error.
I looked for an answer on this but I can't seem to find a direct answer. What does ld: undefined symbols mean. It gives me that error and what causes it.. I am trying to learn about classes and...
A appreciate the help everyone. :) I got it.
how do you just output 2 letters or 1 letter of string though.
I searched the forums and the internet but I haven't been able to find anything for what I want to do. Is there any easy yet begginer(ish) way to remove the last char of a string.
For example:
If I...
Sorry, I thought waiting 24 hours and then posting again was alright. Consindering it was on the second page. Bye.
I realized I was comping the wrong file all day so that code above doesn't even work. Anyone have any suggestions? I know how to find characters and strings but my problem is implementing it. I...
Any ideas?
Okay, I'm so close to getting this done but I've seem to hit a snag.
This program takes two strings and compares them and see what substrings both of them contain. I think it's better if I show it.....
Great, I can't believe all that trouble because of a ! hehe... Now I just have to figure out why it doesn't input the last two names in both the files.. Thanks a lot for your help PJYelton. :)
/*
2. Ordered List
Description: Program that will combine to lists of data and put them in a sorted order.
File: main.cxx
Programmer: ****
E-mail: ****
Compiler: g++
Last modified:...
The problem with that is as soon as there is a word not in alphabetical order in just keeps repeating the word until infinity. I tried to alter it so it swaps the words but it still repeats.