I don't know much about classes which is why I didn't use them for this program but later after learning more I might try and implement it into the program. I just modified the quicksort from this...
Type: Posts; User: c++prog
I don't know much about classes which is why I didn't use them for this program but later after learning more I might try and implement it into the program. I just modified the quicksort from this...
How would I maintain the association between the balance and the id while sorting id in ascending order using your code zalezog? I was able to do it with the old code after changing the parameters by...
Yeah, everything is sorting correctly. I'm just trying to figure everything out.
Why is the "&& i < j" needed even though the while loop that it is within already checks for that? When I comment it out the sort works incorrectly with 4 values and with 5 it crashes but I don't...
Thanks for the help. I don't completely understand it yet but I will work on it.
I need help implementing quick sort on this but everything else works right. I don't get any errors when compiling the program but when I run it and enter the values I get an error that says it has...
The reason I removed all my code was because this was for an assignment and I didn't want anyone to cheat off of it. If you want to see what I have now I can private message it to you.
Nevermind, I've figured it out by looking up information online and editing the function. Thanks to everyone.
I changed the function header to void bubblesort(double *arraya, int length); and now it will compile but it won't sort the array.
No, is it because I'm using a pointer? Because even using the bubblesort function that I have commented out I still get the same error and I am not using a pointer in that one.
This is something that I have been working on but when I compile it I get the can error that says for the line
Could anyone tell me how to fix this?
How would I print out whats in the if else statements then? Sorry for so many questions, it just seems like all the small things are what give me the most trouble in C++. This isn't the first time...
Ok, what I want this function to do is generate two arrays, called box, each with 3 numbers and it will tell the user which, if any, of these numbers are equal. However, the biggest problem I am...
I am doing a challenge that asks the user a name and telephone number and then stores it in a file. This is what I have so far:
#include <iostream>
#include <fstream>
#include <cctype>
using...
Is this what you want me to do?
for (count < 10 && !getline(dataFile,buffer));
getline(dataFile,buffer);
cout << buffer[count] << endl;
This gives my syntax errors. It says missing ';'...
Now I'm having another problem. I just repeated
getline(dataFile,buffer);
cout << buffer[count] << endl; but when I do that it will always print 10 lines and will repeat the last line of the...
Ok, thanks. I was just trying to challenge myself.
If I do that it just prints the third character on the line.
I am working on an exercise that has me ask the user for the name of a text file and then display the just the first 10 lines of it. If there is 10 lines or less, I have to tell the user the entire...
I am doing a problem that asks me to write a program that uses a structure named CorpData to store the following information on a company division and it asks me to store various sales numbers and...
It worked, thanks.
I'm doing some practice problems in my c++ book and this particular one has me stuck. The problem asks to calculate 80% of the amount it would cost to replace the structure but when I try to compile...