1,426 Posted Topics
Re: Where is the text file? If it is not the same location where you .cpp file is then you need to put the exact path to where the file is. | |
| |
Re: You dont have to have it in your .h file for your derived class but you do need to included it in you .h file. | |
Re: line 76 should be b = abcd[1]; not abcd[1]=b Also the use of goto is a big no no for c++. With the loop options availible you should never need to use one. You also need to learn how to indent properly. | |
Re: I would go the polymorphism route. That way if you need to add another standard latter on all you have to do is create a new derived class and add the option for the new standard. | |
Re: No. It says you have to implement this with a [linked list](http://en.wikipedia.org/wiki/Linked_list). | |
Re: What is the code that you have? You need to search through the array and find a row that has enough open seats that are together. | |
Re: Firstly you are not using a vector but an array. You need to have the array in main and pass it to the function that takes in input and then pass it to the average function. | |
Re: Check out the [win32 API](http://msdn.microsoft.com/en-us/library/windows/desktop/ff818516%28v=vs.85%29.aspx). | |
Re: Line 9 of you code is double rightTriangle(double x, double y) Line 25 of your code is double rightTrangle(double x, double y) Notice anything different? I'll give you a hint. Look at the name of the function. | |
Re: The `>>` operator leaves the newline in the buffer. You need to get rid of that before you can use `getline()` since `getline()` stops reading once it sees a newline. Check out this [guide](www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream) that Narue created. It should tell you how to fix your problem. | |
Re: What do you have so far? >Create the logic for a program that prompts a user for three >numbers and stores them in an array. You need an array of size 3 and a for loop to do this >Pass the array to a method that reverses the order of … | |
Re: here is a simple brute force way of doing the nth root of a number. [code=c++] #include <iostream> using namespace std; double NthRoot(double, int); double RaisedTo(double, int); double NthRoot(double number, int nthRoot ) { bool done = false; unsigned short int digits = 0; double temp = number / 2; … | |
Re: If you are mixing the `>>` operator and getline you need to use `ignore()` before calling getline. Give this a try cin.ignore(); <-- added this cout << "Enter the company name: "; getline(cin, company_name); | |
Re: Line 24 needs to be `nodeType* head_ptr;`. That should fix some of the errors. | |
Re: if each number has a space after it you can just use the `>>` operator of the `ifstream` object your using inside of a loop. | |
Re: You either need to use a large number library to handle very large numbers or if you can get away with numbers less than 18,446,744,073,709,551,615 then you can use an `unsigned long long` | |
Re: Do you have a contructor for ListNode? if you do does it set the next pointer to NULL? | |
Re: It has an error because AD didnt give you the complete code. He left part of it for you to complete. You do not need to include the string library you just need to implement the loop that AD did not put in. | |
Re: Can you post the code that is giving you the problem? It is hard to read your screen from here. | |
Re: check out [fstream](http://www.cplusplus.com/reference/fstream/fstream/) | |
Re: You need to make the functions public not protected to use them. | |
Re: Are you saying that running this code will produce different outputs occasionally? | |
Re: Well if you cant use a stringstream you could always stor the line in a string and then manually parse the string yourself. The [atoi()](http://www.cplusplus.com/reference/cstdlib/atoi/) function will convert a `char*` into the int that it represents. To get the `char*` you can use [substr()](http://www.cplusplus.com/reference/string/string/substr/) to get the number you want … | |
![]() | Re: If you want to use sizeof in your for loop you need to do it like for(int i = 0; i < sizeof(ia) / sizeof(ia[0]); i++) |
Re: What compiler are you using? All of you includes are depreciated. It is `<iostream>` not `<iostream.h>`. Also you are inlcuding a cpp file. You never want to do that. Your student class should be defined in two files. xxxx.h and xxxx.cpp. The .h file is what you should be including … | |
Re: trun UAC off then try to install | |
Re: He just want to know how to send a 5V signal? | |
Re: You would want to wrap lines 10-33 in a do-while loop. int continue = 0; do { //lines 10-33 cout << "Do you want to go agian? << endl cout << "Enter 1 for yes 0 for no: "; cin >> continue; } while (continue != 0) // doing this … | |
Re: Yes and no. It really depends on what you are trying to accomplish. If you look at the STL string it has both. | |
Re: What do you have so far? This smells like homework and we do not Just give you the amswer for homework. We will help you if you have a problem but that is it. | |
Re: Do you have to use 3 parallel arrays or can you use a class/struct? If you have to use the parallel array then you need to sort all of them at the same time. It would look something like this string firstNames[]; string lastNames[]; string birthDates[]; // load the array … | |
Re: Well if `<<` is supposed to print oput the next record untill the end then restart then you can have a member variable in you class that keeps track of what record was printed last. Then in your `<<` operator print the next record and increment the tracking variable. You … | |
![]() | Re: No, and that is with a capital "N". Now if you want to contract someone to do it there is a section to do that. |
Re: you are calling the print function on line 56 but you never defined it. | |
Re: Here is a simple program for you. #include <iostream> using std::cin; using std::cout; int main() { cout << "Hello World!"; cin.get(); return 0; } | |
Re: You either need to forward declare you min function or just move it to be above the class. C++ uses a single pass compiler unlike java that uses a dual pass. | |
Re: cases 1, 2, 3, 4 and 5 need a break at the end of them before the start of the next case. | |
Re: line 34 should be int * people = new int[people]; see if that makes a difference. Also on line 51 put delete [] people; | |
Re: Post the code that you have that is giving you the error. | |
Re: One takes a pointer and the other takes a reference. If you have a question you should start a new thread. | |
Re: [Check](http://www.cplusplus.com/reference/unordered_set/unordered_set/) this out | |
Re: Take the input in as a string. #include <string> // to use the string class #include <iostream> using namespace std; int main() { string input; cout << "Enter number: "; getline(cin, input); cout << "You entered: " << input << endl; cin.get(); // pause program return 0; } | |
Re: Well I cant tell anything from this. What line is causing the problem? I am not seeing a call to `delete []` anywhere in this function for `RO` or `IO`. | |
Re: This is how I would format your code. void b_Physics::Collision(const s_Polygon& Obstruct) { float Ntime = 0.0f; s_Polygon Polygon = this->Object.Polygon; switch(this->Object.Motion.HorizDir) { case s_Motion::LEFT: Polygon.MinX = Polygon.MinX + this->Object.Motion.Xvel; break; case s_Motion::RIGHT: Polygon.MaxX = Polygon.MaxX + this->Object.Motion.Xvel; break; default : break; } if(this->Object.Polygon.MinY < Obstruct.MaxY && this->Object.Polygon.MaxY > Obstruct.MinY) … | |
Re: You can't have 2 main functions in one program. You either need to make 2 seperate programs or add the addition function to the first main function and get rid of the second one. | |
Re: You are mixing input with `getline()` and `cin`. iIf you are going to do that then you need to [flush the input stream ](http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream) after the call to `getline()` and before you call `cin >>`. |
The End.