Forum: C++ 3 Hours Ago |
| Replies: 3 Views: 110 Re: Need experienced debugger will pay. More goats does not get more correct code -- just a bigger mess to clean up.
Easier to clean up the code, bit by bit, as Salem said.
(but you do get credit for sense of humor ;) ) |
Forum: C++ 3 Hours Ago |
| Replies: 1 Views: 43 Re: solving a quadratic equation This is programming, not algebra. You must show the multiplication operator, where you can omit it in mathematical expression.
SubfunctionResult = ((b*b)-4(a)(c)); must be
SubfunctionResult = ( b*b... |
Forum: C++ 10 Hours Ago |
| Replies: 3 Views: 60 Re: Char array and Getline question - really basic It kind of depends on how the assignment defines "words". If you mean any sequence of displayable characters, bounded by whitespace (thus, a punctuation would be included with the word it precedes... |
Forum: Geeks' Lounge 1 Day Ago |
| Replies: 52 Views: 3,234 Re: Panopticon (who is watching you now?) There's nothing scary at all about InfraGard (http://www.infragard.net/). It's about education and information sharing. The members and member organizations have no police powers, can't do anything... |
Forum: Geeks' Lounge 3 Days Ago |
| Replies: 5 Views: 130 |
Forum: C++ 3 Days Ago |
| Replies: 3 Views: 109 Re: Sizeof operator help 0 (zero) has to come out the pot somewhere, and the way signed ints work, it comes out of the positive half. |
Forum: C++ 4 Days Ago |
| Replies: 3 Views: 75 Re: help my out put isnt working And, if I may make a couple comments on style.
You have main's variables in global space (lines 8-15). This is generally frowned upon - variables that are global can be modified by all functions,... |
Forum: C++ 4 Days Ago |
| Replies: 3 Views: 75 Re: help my out put isnt working What mrboolf said is correct, you're displaying the address of the costs array.
Also, put line 91 before the output in line 89 - you are not storing the computed cost to the cost array till after... |
Forum: Geeks' Lounge 4 Days Ago |
| Replies: 140 Views: 8,150 |
Forum: Geeks' Lounge 4 Days Ago |
| Replies: 6 Views: 122 Re: Beer with Benefits Mmmmmmm, beer!
Here's some quotations (http://thinkexist.com/quotations/beer/)about the wonderful brew. |
Forum: Networking Hardware Configuration 4 Days Ago |
| Replies: 1 Views: 96 Re: Linksys wireless router problems Better place to ask is in the networking forum (http://www.daniweb.com/forums/forum23.html). Here we just mostly shoot the breeze.
You should state what model router it is. Did you try connecting... |
Forum: C++ 5 Days Ago |
| Replies: 3 Views: 69 Re: unable to use destructor In VC++ 2008, that did not fix the problem. See my previous comments.
When the assignment to c has completed, it's members are pointing to the same memory that a allocated. When c's destruction... |
Forum: C++ 5 Days Ago |
| Replies: 3 Views: 69 Re: unable to use destructor I think the problem here is you need to also define copy constructor and operator= methods. Since you are allocating pointers in the constructor, the system provide shallow copy is not sufficient. ... |
Forum: C++ 6 Days Ago |
| Replies: 2 Views: 80 Re: Call by Reference using Classes In the malfunctioning sample, you have parameter names for the get function the same as the class's members. In the function, the parameters are in local scope, so the x=x+2; is only referencing the... |
Forum: IT Professionals' Lounge 6 Days Ago |
| Replies: 8 Views: 208 |
Forum: C++ 6 Days Ago |
| Replies: 19 Views: 359 Re: Loop/Function errors Your while loop says "Stay here until the user enters a zero for both x and y. Even if I enter two zeroes, I still have to enter an operation option?
You really shouldn't have input values and stop... |
Forum: C++ 6 Days Ago |
| Replies: 15 Views: 232 Re: readfile help And you're mixing up your p's and t's again!
while(file >> name[t] >>distance[t] >>height[t])
{
pObject[p].setName(name[p]); // use name[t]
pObject[p].setDistance(distance[p]); // use... |
Forum: Geeks' Lounge 6 Days Ago |
| Replies: 3 Views: 102 |
Forum: C++ 6 Days Ago |
| Replies: 15 Views: 232 Re: readfile help what are you trying to do with this:
cout <<fill(pObject[q].getName(),7) << //continues ok |
Forum: C++ 6 Days Ago |
| Replies: 15 Views: 232 Re: readfile help in the loop - read data into single string, distance, height variables.
If you need to validate them, do so.
Then assign them to the data members of pObject[p], within the loop.
What you've just... |
Forum: Geeks' Lounge 6 Days Ago |
| Replies: 9 Views: 188 |
Forum: Geeks' Lounge 7 Days Ago |
| Replies: 18 Views: 373 Re: Price of gasoline (petrol to some) - update To get back on topic, US gas price is now at about the level it was in early 2004. In the last six months prices of many goods rose along with gas, due to production and transportation increases. ... |
Forum: Geeks' Lounge 7 Days Ago |
| Replies: 18 Views: 373 |
Forum: Geeks' Lounge 7 Days Ago |
| Replies: 0 Views: 84 PMP When I first saw a book on the shelf, in the computer section of the bookstore ,with this title, I was confused. Really, why would they have picked that TLA for Project Management Professionals? ... |
Forum: Geeks' Lounge 7 Days Ago |
| Replies: 5 Views: 127 |
Forum: C++ 7 Days Ago |
| Replies: 9 Views: 183 |
Forum: C++ 7 Days Ago |
| Replies: 15 Views: 232 Re: readfile help If you were in fact storing to the database ( pObject array) then index p would work. In the code you provided, you are storing to a small local array allocated in the function, so your bounds on... |
Forum: C++ 7 Days Ago |
| Replies: 15 Views: 232 Re: readfile help The problem is paramter "p" to the function. Since it's passed by reference, and if you don't reset it (as I assume you don't want to), it comes back into the function at a value greater than 0. ... |
Forum: C++ 7 Days Ago |
| Replies: 13 Views: 186 Re: fstream problem. every text should cover this
fin.open ( "somefile.txt" );
if( !fin ) // or if( fin.fail( ) )
{
//error handler goes here
}
else
{
//file opened successfully, start reading |
Forum: Geeks' Lounge 8 Days Ago |
| Replies: 6 Views: 168 Re: Man Gets Pissed At Keyboard Keyboard vid - been there ,done that. Got the key imprints in fist to prove it ;)
Treadmill - wonder if there's someone with a remote control hooked up to it? That would be a wicked prank. |
Forum: C++ 8 Days Ago |
| Replies: 13 Views: 186 Re: fstream problem. You're asking a question that's not exactly what I think you mean.
if ( (! ifile.size( ) ) == 0 ) means, logically negate the value the size function returns, giving you a boolean true or false... |
Forum: C++ 8 Days Ago |
| Replies: 13 Views: 186 Re: fstream problem. And, the test you're doing is only testing the filename the user entered, it does not test if there's actually a file or if it has any content.
(this should have come after my next reply - they got... |
Forum: C++ 8 Days Ago |
| Replies: 13 Views: 186 Re: fstream problem. That should work. Please post the exact data file contents you're trying to read. |
Forum: C++ 8 Days Ago |
| Replies: 19 Views: 359 Re: Loop/Function errors while (x || y != 00) ;
You cannot compare in that fashion and get the result you want. What your statement says is while ( x OR y ) not equal to 0 which compares the boolean result of ORing x and... |
Forum: C++ 8 Days Ago |
| Replies: 13 Views: 186 Re: fstream problem. What are the data types of the variables?
With the mdy variables as ints and the c as a char, it seems to work for me - I get the negative values.
A full code sample illustrating your problem will... |
Forum: C++ 8 Days Ago |
| Replies: 11 Views: 177 Re: Strange errors in program Well, you're in the C++ forum, thought you'd be using C++.
In C, I suppose you can still use the getchar(), but you need to check that it's not the newline that's just been read. |
Forum: C++ 8 Days Ago |
| Replies: 11 Views: 177 Re: Strange errors in program No, it has to do with how you're getting the input. getchar() grabs every char entered, including the newline. You end with extraneous data in your array.
If you enter the 16 characters in one... |
Forum: C++ 8 Days Ago |
| Replies: 11 Views: 177 |
Forum: C++ 8 Days Ago |
| Replies: 11 Views: 177 Re: Strange errors in program It runs 4 times for me. The prompt to enter another row is in a bad place, it comes up one more time after the last row has been entered.
Perhaps
// printf("Enter the first row: "); //delete... |