This seemed to work
template<typename T>
list<T> listIntersection(const list<T>& L1, const list<T>& L2)
//list to return
list<T> temp;
//iterators
list<T>::const_iterator L1itr =...
Type: Posts; User: misterMatt
This seemed to work
template<typename T>
list<T> listIntersection(const list<T>& L1, const list<T>& L2)
//list to return
list<T> temp;
//iterators
list<T>::const_iterator L1itr =...
I can see that after L1itr, and L2itr both hit 5(original data), that L2itr++ is done twice. Instead of it being just 6, it jumps to 10 because it's meeting that second condition - but even then in...
Ahh yeah. That would be the first issue. :D
while(L1itr != L1.end() || L2itr != L2.end()){ } would be the correct one
Hi guys, this is a homework assignment. Right now, I'm thinking that my solution should probably work - but of course it doesn't and I cant spot the problem. I was hoping one of you would be kind...
I'm supposed to implement a variant of the josephus problem for my C++ class using an STL list. I've got it pretty much half working but there is a logic oversight that I'm making and I keep getting...
I'm interested in learning a little about music visualization. Google turned up nothing of any use on the subject as far as I could tell.
Anyway, what I'm talking about is a graphical display of...
Should I rephrase? In what context would representing an RGB+alpha value as a float be useful?
A memory saving device perhaps?
Why would you want to do this?
What this person is saying - in a nutshell, is that functions generally have what are called 'declarations' at the top of the file to let the compiler know a little about the function - most...
I'm confused. It still fails compilation for me.
yes I do, at the top of my file:
double velocity_x(int vel, int degrees);
double velocity_y(int vel, int degrees);
double delta_x(double vel_x, double time);
double delta_y(double vel_y,...
Hey guys, I'm trying to create a little program here, but I'm having some trouble with it.
I'm getting the following error message: error C2064: term does not evaluate to a function taking 2...
A quick question about the above, however. The book I'm working through suggested I implement the function to learn about recursion. The book also stated that this is a popular demonstration of...
My mistake on the missing return bit. I'm not sure why I overlooked that... Anyway, I've updated the conditions of the second else if - they should now properly match the wikipedia entry.
...
Is my implementation correct? I'm assuming it's not because I keep getting zero returned... Where am I going wrong?
//implementation of the recursive ackermann function
int ack(int m, int n)
{...
you do perform an operation where you are mixing variable types. could that be the cause of precision loss?
What does the ampersand (&) represent when used next to the string declaration and the setName() function parameter?
What about the whole .999... = 1 'proof'?
http://en.wikipedia.org/wiki/0.999...
I used the Pythagorean theorem as an example. Of course, trig identities were never fully explained to us either.
Unfortunately where I went to high school, most teachers weren't preparded to...
It worked for me as well. Of course, your output is wonky if you enter a value that doesn't have a fractional part to it...
Unfortunately, the public education system here in the states completely ignores proofs entirely. So whatever the kiddies learn in math class - they won't understand why it works how it works.
...
I thought Mass Effect was a little short to be honest. The whole thing seemed a bit rushed is all.
The PC has a lot of awesome looking games on the horizon.
I have to say, I've been pretty...
Try this: http://pixwiki.bafsoft.com/mags/5/articles/circle/sincos.htm
Relax guys, it's not for school. I'm reading Beginning ANSI C++ by Horton and trying to keep up.
In the book, he mentions that making use of the string class is preferable over the use of a char...
That sort of defeats the purpose of the exercise though doesn't it?