1,362 Posted Topics
Re: triple check that your prototypes match your definitions, and that your calls to the functions agree with parameter lists. | |
Re: Look [URL="http://tinyurl.com/ana6ro"]here[/URL] | |
Re: Strangely entertaining. Maybe it's just a flashback to some TV shows from the 60's where monkeys were the actors. Maybe this is just a prequel to Planet of the Apes? | |
Re: Yes, it's more efficient to just pass the pointer. It adds security if that pointer is const. Thus, user of the class cannot modify the array member - preventing array overruns. If it's needed to be able to modify the name without using any class members, then the user can … | |
Re: Never underestimate the ability of bureaucrats to do dumb stuff. | |
Re: If I understand your problem correctly, all you need to do is allocate variables to hold the sum of normal hours worked and OT hours worked, set them to 0. As you do the pay calculations, add the hours to their corresponding sums. | |
Re: Here's the[URL="http://yugop.com/ver3/stuff/03/fla.html"] human clock [/URL]I like. Really busy guy! ![]() | |
Re: Now that you have the average, you again loop through the array, comparing each element to that average. | |
Re: Your array is not wide enough to hold the names. To hold names with three characters ( "ali" ) you need to have 4 columns. What you really have is three arrays of char, not strings, so strcpy is not really working right. [code]char student[3][4]; // for(i=0;i<number;i++) cin >> student[i]; … | |
Re: To add to that - you generally don't want to open (and close) a file within a loop- that can actually slow the program down considerably. You should open the file before the loop, do the writing, then close the file after the loop concludes. If you absolutely, positively have … | |
Re: Use getline to read each string, setting the delimiter to be the comma character. Then loop through reading in the floating point values, each read will halt at the first non-numeric char (comma or newline). Then read the next character into char, test that char to determine if it's the … | |
Re: It all worked for me, after adding [icode]#include "person.h"[/icode] to the student.h file. Using Visual C++ 2008 | |
Re: Function prototype: int loadArray(const string[][2]); Function definition: int loadArray(string secArray[][2]) Not the same signatures! Do you really need/want the const qualifier in the prototype? | |
Re: Great find! Don't miss Discourses on Graphical User Interface! | |
Re: Actually, the loop for a two element array is [icode]for( i = 0; i < 2; i++ )[/icode] | |
Re: Any way you play the numbers, there's plenty of blame to go around. Why are upper managers being paid hundreds of thousand, or even millions, when the companies are losing money? How is rewarding failure an incentive to improve? The UAW has painted the industry into an untenable corner, with … | |
Re: As stated, not directly. But if you really, really think you need to do so, you can wrap an array inside a struct, which can be returned. It's not necessarily a wise thing to do. Example [code] #include <iostream> using namespace std; struct foo { int arr[5]; }; foo bad( … | |
Here in the USA the price of gas has been going down more quickly than its rise this summer to record prices, as [URL="http://www.gasbuddy.com/gb_retail_price_chart.aspx"]this chart [/URL]shows. The trend is similar to that of [URL="http://investing.thisismoney.co.uk/companyresearch/100815/Brent_Crude/company_charts.html"]crude oil[/URL]. Are prices in the rest of the world changing similarly? Does anyone really understand the … | |
Re: Please use full words in your question, and follow the links given above to see how to better post questions here. The main thing you need to study up on is string input and manipulation. Your array of characters is going to hold just one string (song title), not 30 … | |
Re: That value is correct as maximum for signed long long. What specific compiler are you using? Look at the include file <limits.h> to see what types and their ranges are available in that compiler. | |
Re: Now that would be a sweet flight simulator. Wonder what your power bill would be? | |
Re: I don't see that expression used in the files you've attached. Shouldn't it be [icode]((Table*)this)->Table::isMarked[r][c] [/icode]? | |
Re: Remember that in any argument with your GF, she has the last word. Anything you say after that is the beginning of the next one.:icon_biggrin: | |
Re: More DCC decoders for my model trains. And the time to install and play with them! | |
Re: 1) Google is your friend -there's lots of information out there about reading/writing files in binary mode. 2) - most any image, audio, video file has some type of formatted header. You need to look up the data for the specific file type you're dealing with. | |
Re: The test portion of your comparison for loop can be simplified a lot. It need not test that i >= 0, you just set it to 0. You don't need to test the j index at all. When either of the indexes has reached the midpoint, stop. You also don't … | |
Re: In a backpack? More importantly, how the heck could one actually use it? I'll stick to my 9-tool version, that's quite enough. | |
Re: Or by [URL="http://www.prairieedge.com/category/23/399"]these[/URL] Note the size of the first sculpture. I'm amazed every time I see these pieces. | |
Re: Note to self - don't do a running workout barefoot and in a long dress. | |
Re: No, velocity is not initialized. That would seem to be a value the user must enter. Also, in your prompts to the user, specify the angle is in radians, not degrees. | |
Re: [code] while (people % 1000 < 500) { int star = 1; cout << '*'; } [/code] Think about what this bit is really doing. First, you want to print a final star if the population number was > x500. Is that what your code does? Why a loop? You're … | |
Re: Molotov cocktail == small WMD Deadly force authorized. end of story. | |
Re: Upgrading a machine to Vista is, IMO, a crapshoot. First, most PCs that were fine in XP will need hardware upgrades to meet the realistic minimums for Vista, so the cost to upgrade becomes nearly, if not, the cost of a new PC. Then, drivers............. On a decent machine made … | |
Re: 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 help us help you. | |
Re: Look at the spelling of the file name you are attempting to open. A good idea is to have your reading function return a value indicating success (or how much success) or failure - use that to determine if the program should even go on to attempt processing the data. | |
Re: [QUOTE=tech291083;320299] When I compile the first one or the second one, there comes an error message underneath the code window saying " multiple definition of `main' " Do not know what I am doing wrong here. Any suggestions? Thanks.[/QUOTE] Having two files in the project, both with function main( ), … | |
Re: Do you mean that you have four separate arrays, and you're trying to find the average across them? If so, enclose your code inside a loop, controlled by variable "counter" One correction, to get the average [code] average= ( a[counter]+b[counter]+c[counter]+d[counter] ) / 12; [/code] enclose the addition in parentheses so … | |
Re: Better place to ask is in the [URL="http://www.daniweb.com/forums/forum23.html"]networking forum[/URL]. Here we just mostly shoot the breeze. You should state what model router it is. Did you try connecting it directly to the computer (lan cable) rather than wireless? Also look for the hard reset button, that may clear up problems. … | |
Re: This is programming, not algebra. You must show the multiplication operator, where you can omit it in mathematical expression. [code]SubfunctionResult = ((b*b)-4(a)(c));[/code] must be [code] SubfunctionResult = ( b*b ) - (4 *a *c ); [/code] (All the parenthesis are actually not needed, but can add clarity for some.) Also, … | |
Re: These are basic questions that should be explained in your text, and in your lessons. In short, the default constructor will allocate the date member(s), sales[4] in this case, but will not initialize the array to any specific values. That would occur in a constructor that you create, such as … | |
Re: 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 ;) ) | |
Re: 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 or follows), then cin >> would do the job of isolating individual words. If you have a more … | |
Re: [QUOTE=abhishek.com;746910] [B]And my second question is why the range of int, float ,are always like -32768 to 32767 etc... why it is not like -32768 to 32768, why there is a gap[/B][/QUOTE] 0 (zero) has to come out the pot somewhere, and the way signed ints work, it comes out … |
The End.