So, I've been tweaking some of my program, and I am getting stuck in an infinite loop and this is because I'm not decrementing my recursive function by one, I know this. However, when I am calling my...
Type: Posts; User: porsche911nfs
So, I've been tweaking some of my program, and I am getting stuck in an infinite loop and this is because I'm not decrementing my recursive function by one, I know this. However, when I am calling my...
how would i fix this then?
that would make sense, haha. Unfortunately, I get the same error message. It has to do something with calling the private vector....
If I have this vector in the private portion of my class I have:
vector <int> numbers;
and I have this in my main() function:
ifstream in_file;
in_file.open("numbers.dat");
all i am asking for some one to give me a little push in the right direction with some code. Any little bit would help out a ton! I appreciate all of the help!
its OK, i'm up for it. would you know a way to get me started cpjust?
oh yeah, and then this if this is relevant:
void numbers::sort_down()
{
numbers = sort_down(numbers);
}
thanks again!
oh, well regardless of the optimization, i would like to know how to turn this private member function into a recursive function. I want to test the waters, so I know how to do it if need be in the...
well recursive functions are supposed to take a for loop and consolidate them down considerably to make it easier for the programmer and the program ultimately run a tad faster. so to optimize the...
but do you know how to help me out by chance?! ;)
better practice, understanding how everything "under the hood" works
OK, so here is a basic for loop sorting function that I have coded prior to my current program:
float max;
int temp;
for (int i = array_size - 1; i >= 0; i--) // Reading the...
I am trying to remove an element from a vector, and I was told to use vector.pop_back(), but from the tutorial on this site, it claims the member function removes the last element. So if my...
you're absolutely right anon. Thanks!
I'm an idiot. Thanks for your extra set of eyes, I had a late night ;)
sure:
#include <iostream>
#include <cstdlib>
using namespace std;
class CounterType
{
public:
@ bithub, I fixed this (oops, I definately overlooked that), but I still get the same kind of value outputted.
For some odd reason, I'm getting totally bogus answers (like answers in the 2 billions when it should output 2)
so I believe I'm initializing my term1 object correctly (initializing to 2) but I am...
Amen
its because in this line
you have a semicolon after the if statement. take that out and then put brackets after this and then close that bracket where needed. I haven't checked the code or...
OK, i fixed that part of my program, kinda, but now I have a new problem for some reason: My program will not output what I would like for it to be. This is weird, because it seems as if it would be...
its a new question though, its not the same question as previously. i had my disclaimer at the top there explaining the previous post. I am not breaking rules.
can you show me an example using pointers please grumpy? I want to keep my program consistant if you do not mind. Thank you though for your idea, that would definately make sense.
I mean if I had the input "Hello to the world," I want to know how to assign a pointer to a word, so that I can do essentially the same thing as before, but have the program output, "world the to...
In my previous pointer post, I have a user input:
and I converted this string to:
using this code:
istringstream break_apart(input);
input = "";
while (break_apart >> word)
{