1,426 Posted Topics

Member Avatar for Akis2000

if this is line the line with the problem [code=c++] cout<<"Series "<<series<<" is approximate on "<<counter<<" iterations"<<" Series "<<series<<" is "<< fixed <<setprecision(digits) << pi1; [/code] after [icode] " is" [/icode] im not sure what you are trying to do in [icode] "<< fixed <<setprecision(digits) << pi1; [/icode] is this …

Member Avatar for NathanOliver
0
125
Member Avatar for di mo

I believe from what we have here the string will be in the file "beads.in". the first line in the file will be the number of beads and the second line will be the string with the r,b,w characters. what it wants you to do is to parse through the …

Member Avatar for Lerner
0
207
Member Avatar for kailisr

please open your textbook or your help file and look at the types of operators are in c/c++ before you start typing in symbols. % is not percent in c/c++ it is an operator dealing with integer division.

Member Avatar for WaltP
0
146
Member Avatar for Liszt

one problem will always exist. there are a lot of people like us out there and every time one of us comes up with a brilliant idea its just a matter of time before a another person comes up with a way to break it. take windows xp for example …

Member Avatar for Liszt
0
104
Member Avatar for waehake

your function for geting the sales for each month is messing you up a bit. you are not returning anything so im not sure why your compiler isnt flagging an error. anyway your input function should be returning the whole array so that when you write [icode] month_sales = sales_input(month_sales, …

Member Avatar for NathanOliver
0
115
Member Avatar for NathanOliver

Hi have made some code that will generate alphanumeric passwords and output them into a file. Each password size has its own function so i have 16 functions for sizes 1-16. The code works great its just that as you go up one size in the password size it will …

Member Avatar for NathanOliver
0
89
Member Avatar for Adexter

move line 7 [icode] char AssignGrade(char LetterGrade, studentType students[]); [/icode] to after you declare you studentType struct on lines 13-19 [code=c++] #include <iostream> #include <fstream> #include <iomanip> using namespace std; void StuRead(indata, studentType students[]); // AssignGrade() function was here void Highest(); void Print(students[]); struct studentType { string fName, lName; int …

Member Avatar for Adexter
0
2K
Member Avatar for all blacks

in your [icode] void viewAllInfo(Person year1[], int size) [/icode] you are getting a redefintion error delete your decleration of i from this line. [icode] int m1, m2, m3, m4, i = 0; [/icode] to get this [icode] int m1, m2, m3, m4; [/icode] also in my compiler i hade to …

Member Avatar for NathanOliver
0
4K
Member Avatar for BlackStar

if want the node clear before you get a new one [code=c++] Head = NULL; //or Head = 0; Node Head = new Node; [/code] this will make sure it is empty

Member Avatar for BlackStar
0
414
Member Avatar for miskeen

well you could do this [code=c++] ofstream fout("TheOneFile.txt", ios::app); fout << something; fout.close(); [/code] this way everytime you need to ouput something into the file you open it, store the information, then close the file. this way you can have every file of source code store information into the file …

Member Avatar for miskeen
0
109
Member Avatar for Falkoner1

If you want the address of the pointer you would want to say [code=c++] pointer = &begin.sim[sim].field[x][y].rabbits; [/code] that will give you the address of the pointer not the address that the pointer holds. hope thats what you wanted

Member Avatar for Falkoner1
0
4K
Member Avatar for peste19

I would cycle through each letter in the string that was inputed an see if it was repeated then you will be down to at most a number of checks equal to the size of the string.

Member Avatar for NathanOliver
0
1K
Member Avatar for gr8ash

you could recive the numbers as strings then parsing through them find the decimal point then you will know how many digits are before the decimal point and how many are after for each number then its just a matter of displaying them as you want. maybe that will work …

Member Avatar for ArkM
0
228
Member Avatar for nicolap

here is another solution [code] double input; int test; cout << "Please enter an integer: "; cin >> input; test = input; if (test != input) { cout << you did not enter an integer."; } [/code] basicaly what you are doing is let the number come in as a …

Member Avatar for vmanes
0
208
Member Avatar for stonerain

im not sure why you are even returning C in this function becase you already have it defined in the global namespace. anything you do inside the function will automaticly change C to what you are doing. also for your information even though an array is a type of pointer …

Member Avatar for Salem
0
1K
Member Avatar for scuzzo

try this [code=c++] #include <iostream> #include <fstream> #include <string> using namespace std; const int htlen=5; const int ascLEn=256; const int ecryptCode=10; void print_usage() { cout<<"Usage"<<endl; cout<<" lab12 -e file1 file2 Encrypt file1 and write cyphertext to file2"<<endl; cout<<" lab12 -d file1 file2 Decrypt file1 and write paintext to file 2"<<endl; …

Member Avatar for NathanOliver
0
93
Member Avatar for BlackStar

that is because you do not have a function that can convert struct A to struct C. you must supply one to the compiler otherwise it doesn't know what to do

Member Avatar for NathanOliver
0
101
Member Avatar for bmcutler011

I'm sorry but i think you are going to have to make a sort function. i don't see any other way to take in unsorted data and but it into a list in order. you might be able to check and see if the number you are getting is larger …

Member Avatar for NathanOliver
0
143
Member Avatar for lqdo

have you tried removing the <= from [icode] for( int x = 0; x <= pf.platform_width; x++ ) [/icode] you may be overwriting the bounds because going to the pf.platform_width with it being equal to 15 will actual give you 16 loops try [code=c++] for( int x = 0; x …

Member Avatar for NathanOliver
0
131
Member Avatar for NathanOliver

hi i have a very large array that i want to populate but i don want to run the for loops every time so i thought i would right a program to output text to fill the array and was wondering if this would work. the array is [icode] int …

Member Avatar for NathanOliver
0
107
Member Avatar for olejl

you never really want to define a global variable. if the variable is to travel around you can declare it in you main.cpp file in the [icode] int main() [/icode] function as a pointer and then pass it around to your different functions and classes as a pointer. [code] void …

Member Avatar for ArkM
0
622
Member Avatar for weary01

first you must have points stored in a file before you can get them from a file. [code=c++] int plot[21][75]; ofstream fout("MyFile.txt"); for (int i = 0; i < 21; i++) { for (int j = 0; j < 75; j++) { plot[i][j] = (i + j); fout << plot[i][j] …

Member Avatar for NathanOliver
0
117
Member Avatar for songweaver

im guessing that you are getting an error with trying to store into inches[ct]. you might want to recheck on how to declare an array.

Member Avatar for siddhant3s
0
135
Member Avatar for slim2hott

Ancient Dragon and jen140 are both correct you have a missedmatched bracket from line 214 that does not necsisalry mean that the bracket on 214 is wrong but there is one before that. make sure you know how your debugger works. FYI it will always flag an error past where …

Member Avatar for NathanOliver
-2
677
Member Avatar for kkbronner

move your `cout << endl` to after the loop with the n term for (int i = 0; i < 6; i++) { for (int n = 0; n < (i+1); n++) { cout << n; } cout << endl; }

Member Avatar for NathanOliver
0
152
Member Avatar for scuzzo

one thing i would suggest is that you should make a varible class that holds all the information, then you could store them in a dynamic array inside the polynomial class and sort them by order of the power of x. [code] class varible { public: varible(coeff, powerOfX); ~varible() {} …

Member Avatar for NathanOliver
0
108

The End.