need to see if yall can help me out with this program, almost done. 1st problem is when it sorts the names that the user enters it prints them down 20 carriage returns down. Of course if I enter 20...
Type: Posts; User: tonedogz71
need to see if yall can help me out with this program, almost done. 1st problem is when it sorts the names that the user enters it prints them down 20 carriage returns down. Of course if I enter 20...
just starting this program. Can somebody tell me why i am gettng a getline not defined error?
#include<iostream>
#include<cstring>
using namespace std;
thanks guy. Yes i just threw that 256 in there as a number because the assignment called for no more than 20 names and the names could be of any length, but he would rather us figure out how to make...
for some reason in every program i work on when i use strings and getline() i always get the error that getline is undefined and in my bubblesort on every instance of names[] i get Error cannot...
I have a program i need to write. It asks the user to enter names and then stores them in an array, takes input until the "enter" key is the first character of a string. I also need to make the...
finished product. Works like a champ. Thanks to all.
#include<iostream>
#include<iomanip>
#include<cstring>
using namespace std;
void getInput(char names[][15],int number);//function...
if i change it to std::string i get the error "expression must be a modifiable value" in the bubblesort on all 3 lines
#include<iostream>
#include<iomanip>
#include<cstring>
using namespace...
i would use the string functions but i have to use a bubble sort to sort the names in alphabetical order
Keep getting "Expression must be a modifiable value" in the bubble sort. Any suggestions?
#include<iostream>#include<iomanip>
using namespace std;
void getInput(char names[][15],int...
Why would an assignment call for using a 2-d array for storing single names. Doesn't make sense to me. I guess I could read it in as a string and use strcpy () to copy it to a char array
The assignment called for storing the names in an array of characters. I need to look up the syntax for getline() if that would be better than cin. I've just always used cin.
Thanks that worked like a champ. The problem im having right now is when i try to call the functions. Not sure if im doing it right. I can find all kinds of things about calling string functions but...
Im sure this is an easy question to answer but i can seem to find it. Supposed to ask how many names to enter and then enter the names, first name only and store into a two dimensional array. cant...
OK I have the program working just fine, even figured out how to call the bubble sort functin ( that took a while). What is the best way to test each input of the array individually to see if it's an...
Yes. It helps if you read the directions right. Evidently I was supposed to ask the user how many numbers they want to enter. Definitely makes more sense to do it that way.
ok i got the function to work. still not sure why if i only put in 10 numbers and hit enter it wont run the program. I have to enter 10 more number before it will sort them.
...
Have two problems with this program:
1. The user is not supposed to enter more than 20 numbers, but the program wont move on unless 20 numbers are enteres.
2. How would i put the bubble sort part...
#include <iostream>
using namespace std;
void getnum1(double);
void getnum2(double);
double num1,num2;
inline double add(double num1, double num2)
{
return num1+num2;
Im trying to figure out how the user can enter 'x' to exit the program at anytime, not just the last question. Is there a way to do this for the whole program without an if statement on each...
i tried every do while i can think of. setting bool to true and false, setting while to equal and not equal to the bool value. Also tried putting while to not equal to +,-,*,and /. For some reason...
#include <iostream>
using namespace std;
int main()
{
cout<<"*************************************************************"<<endl;
cout<<"* ...
supposed to make this code and when you press "c" should clear the screen and run the program again and when you press "x" should exit. It works but if i press c or x it will still ask the 2nd...
Thanks a lot. I extended the number up to 500000 and noticed that the float output changed. You are right. Thanks again
Wow. Maticus, Thanks a lot. A little new at this. I think i got it to run. One question would you think that returning a double and a float in this instance would return the same numbers? All 4 of my...
No problem. trying to add 1/1+1/2....1/5 a nd 1/5+1/4.....1/1. Using one loop. Print out each result in a float and a double. I can get it to run just fine with 2 loops. Im trying get it to run with...