All we have is this:
class DynamicFraction
{
public:
//Filling in Constructors and Destructors; Proper getters and setters; Required utilities and operator functions
private:
Type: Posts; User: Bash
All we have is this:
class DynamicFraction
{
public:
//Filling in Constructors and Destructors; Proper getters and setters; Required utilities and operator functions
private:
So I'm new to this whole class thing. My prof gave me a main function and asked us to derive class defenitions and stuff. Main is as follows:
int main( void ) //do not change or modify this...
OOOOH. That worked. :D
But what if I wanted to do the same thing by calling compare(); as a non-member function?
Edit: just read what swoopy said. Be back after going over mah code.
Edit2: I...
So where would I add "iZ = frA.compare (frB);" in the second program? I added it just before "iZ = compare (frA, frB);" and it didn't work
Sorry about that, CornedBee.
My error:
Linking...
cis25Fall2007AmolMundayoorPostlabEx1.obj : error LNK2001: unresolved external symbol "public: int __thiscall Fraction::compare(class...
So I've been working with classes for a while. After fiddling around, I came up with two instances of code that pretty much did the same thing. I wanted one to be using a member function and the...
It does indeed clarify a lot. But I still have a couple more questions...
1) Shouldn't
int &a = b; // a references b.
be
int a& = b; // a references b.
2) If I swap the address of...
I know that the "*" is a dereferencing thingy, and this is how I think about it:
Is that a wrong way to think about it?
And for the first one:
I see =) Thanks for all the input.
I've been reading about pointers, and there's something that has been bothering me and driving me nuts. What exactly does a pointer point to? To the address in...
OH!
should I have to write it like so:
(a>b),(c>d)
@Daved: You mean cout outside of the ternary operator? Can you give me an example? :(
I personally LOVE Notepad++
Is there a way I can sort 3 integers using only the ternary operator and the usual <, <=, >, >=, ==, != ? My prof wants it for 4 integers, but I can't seem to figure out how to compare 3 digits with...
Well my trouble is I just don't know what exactly those void swap( ); thingy does. If used correctly, what is it supposed to do?
Well our prof had asked this question in class:
(1) Given that the following prototypes are given in some program. What would and may be potential problems from each of the following function...
Sorry for the late reply :). It'll be my pleasure to post it here.
#include <iostream>
#include <string>
#include <limits>
using namespace std;
int main ()
{
Oh man, I ran into so much trouble trying to come up with solutions as to why I couldn't just copy paste your code. Copy pasting is baaaaad, but in the end a lot of good came off of it as I knew more...
matsp, I'm sorry to say that what you said went way off the top of my head :p
After a lot of googling, I came across this code chunk, but I've bolded and underlined parts that I don't get:
...
I still haven't figured out the n-digit part, but I'll take care of it later. I was attempting to modify the program even more, for example, giving feedback when you enter a float I want my program...
That's interesting, because I've never come across a for-while loop before.
What if I wanted my program to accept an n-digit integer instead of a 5-digit integer (I didn't know how to solve it...
OHHHH, I see what I was doing wrong. After fiddling with the for loop, I couldn't come up with something that actually worked. It's kind of a bummer to me that my for loop didn't work, but I made a...
I was hoping to use iSumDump as a temp value. I wanted to keep storing the remainders of teh division in iSumDump and keep adding to iSum. For example,
If the number is 94602, I want iSumDump to...
So I have this homework assignment that's due on Friday, and I had started working on it. Basically what we have to do is accept a number (like 95468) and write a program that outputs the sum of the...
Thanks for both the replies, MacGyver and matsp :) I now have an understanding of it and pray they don't go away.
About the getline function - can you use it to store a string in an array? For...
So I've been taking a C++ in school and sometimes it seems like I've to turn to sources other than my prof for help. Hence after some googling, I'm here. Now I have a few questions.
I've been...