1,362 Posted Topics

Member Avatar for deerowbear

triple check that your prototypes match your definitions, and that your calls to the functions agree with parameter lists.

Member Avatar for deerowbear
0
74
Member Avatar for avillachandok
Member Avatar for Ancient Dragon

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?

Member Avatar for vmanes
1
28
Member Avatar for rosenberg_a

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 …

Member Avatar for StuXYZ
0
154
Member Avatar for GrimJack
Member Avatar for GrimJack
0
73
Member Avatar for user2009

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.

Member Avatar for vmanes
0
133
Member Avatar for The Dude

Here's the[URL="http://yugop.com/ver3/stuff/03/fla.html"] human clock [/URL]I like. Really busy guy!

Member Avatar for starsinthesky
0
158
Member Avatar for maccold321

Now that you have the average, you again loop through the array, comparing each element to that average.

Member Avatar for vmanes
0
112
Member Avatar for mahdiahmadirad

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]; …

Member Avatar for mahdiahmadirad
0
188
Member Avatar for Yaserk88

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 …

Member Avatar for Yaserk88
0
132
Member Avatar for timos

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 …

Member Avatar for vmanes
0
89
Member Avatar for tones1986

It all worked for me, after adding [icode]#include "person.h"[/icode] to the student.h file. Using Visual C++ 2008

Member Avatar for vmanes
0
271
Member Avatar for dvsConcept

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?

Member Avatar for dvsConcept
0
133
Member Avatar for Salem
Member Avatar for Dave Sinkula
Member Avatar for vmanes
1
156
Member Avatar for winrawr

Actually, the loop for a two element array is [icode]for( i = 0; i < 2; i++ )[/icode]

Member Avatar for Freaky_Chris
0
140
Member Avatar for Ancient Dragon

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 …

Member Avatar for GrimJack
0
206
Member Avatar for harryoma

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( …

Member Avatar for ddanbe
0
82
Member Avatar for vmanes

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 …

Member Avatar for Dave Sinkula
0
248
Member Avatar for sinduja

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 …

Member Avatar for vmanes
0
120
Member Avatar for sillyboy
Member Avatar for arunciblesp00n

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.

Member Avatar for ArkM
0
5K
Member Avatar for Salem
Member Avatar for GrimJack
0
148
Member Avatar for _KD_

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]?

Member Avatar for _KD_
0
133
Member Avatar for flaco

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:

Member Avatar for techbound
0
198
Member Avatar for christina>you

More DCC decoders for my model trains. And the time to install and play with them!

Member Avatar for techbound
0
484
Member Avatar for akm3

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.

Member Avatar for Murtan
0
126
Member Avatar for mrnutty

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 …

Member Avatar for grumpier
0
99
Member Avatar for The Dude
Member Avatar for The Dude

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.

Member Avatar for The Dude
0
65
Member Avatar for The Dude

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.

Member Avatar for The Dude
0
60
Member Avatar for The Dude

Note to self - don't do a running workout barefoot and in a long dress.

Member Avatar for jbennet
0
55
Member Avatar for The Dude
Member Avatar for Se7Olutionyg

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.

Member Avatar for vmanes
0
105
Member Avatar for meistrizy

[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 …

Member Avatar for meistrizy
0
104
Member Avatar for jasimp

Molotov cocktail == small WMD Deadly force authorized. end of story.

Member Avatar for jbennet
0
229
Member Avatar for Ancient Dragon

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 …

Member Avatar for Jen0608
3
400
Member Avatar for The Dude
Member Avatar for The Dude
Member Avatar for imput1234

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.

Member Avatar for imput1234
0
162
Member Avatar for MC Rove

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.

Member Avatar for vmanes
0
80
Member Avatar for The Dude
Member Avatar for tech291083

[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( ), …

Member Avatar for Salem
0
2K
Member Avatar for FrancisC07

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 …

Member Avatar for vmanes
0
279
Member Avatar for josco69

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. …

Member Avatar for hotmatrixx
0
137
Member Avatar for benji_k

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, …

Member Avatar for benji_k
0
144
Member Avatar for robgeek

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 …

Member Avatar for vmanes
0
145
Member Avatar for Undermine

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 ;) )

Member Avatar for vmanes
0
99
Member Avatar for DemonGal711

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 …

Member Avatar for DemonGal711
0
100
Member Avatar for abhishek.com

[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 …

Member Avatar for vmanes
0
119

The End.