1,362 Posted Topics

Member Avatar for koban_alche

Better would be to use a system sleep function. The looping method will tie up the processor doing needless work (just watch TaskManager while the looping code runs) In Windows, you can use [code] #include <iostream> #include <windows.h> using namespace std; int main( ) { cout << "sleep" << endl; …

Member Avatar for Tom Gunn
0
138
Member Avatar for Knoxx

Look at the code you have, divide it into chunks that make logical sense to be together. At a minimum, the input section and each of the calculations should be individual functions. You might have one function that groups all the calculations into a single call from the main( ). …

Member Avatar for Knoxx
0
105
Member Avatar for matthewl

Do virtual machines count? I could easily find myself running a VM on my main desktop, as well as the host OS, RDP into my machine at work which is also running a VM, and there's the laptop beside me. That's 5.

Member Avatar for jbennet
0
301
Member Avatar for seakayaker

I've found that compiling from the command line gives an executable that will stand alone. At least for projects with a single source code file.

Member Avatar for vmanes
0
190
Member Avatar for The Dude

6 on the beertender test. Common Sence Meter: 84 But should we put any stock in a "Common Sence" test? What's "sence"?

Member Avatar for vmanes
0
70
Member Avatar for Der_sed

Since you have a very formatted data, use getline to read up to the commas, and on the last item of the record use getline with no specified delimeter to get you to the end of line. You will have read each item, if only into a temporary string which …

Member Avatar for vmanes
0
114
Member Avatar for vmanes

It took the guy 5 years to record this all over the world and put it together [url]http://vimeo.com/moogaloop.swf?clip_id=2539741[/url] Turn up the speakers :) It runs a bit over 5 minutes

Member Avatar for johnvitc
0
121
Member Avatar for aomran

As you can see, it's very hard to follow your code without the indenting. Please use code tags, like [noparse] [code] your code goes here [/code] [/noparse] And it would be clearer if you don't give us big blocks that are commented out - just show what's in your code.

Member Avatar for aomran
0
123
Member Avatar for Talguy

Does the error occur on the first line attempted read, on some line in the data file, the last line, or after the last line?

Member Avatar for Talguy
0
118
Member Avatar for buriza

you need to separate the parts of a for loop with semicolons, not commas.

Member Avatar for Sky Diploma
0
93
Member Avatar for DC257209

And, you are doing all the calculations before you have gotten the height value from the user. Get input Do the math Show results

Member Avatar for vmanes
0
291
Member Avatar for Wolf CCMLG

OK, you found the compile time error. Now, there's still a potentially fatal logical error to be corrected.

Member Avatar for vmanes
0
145
Member Avatar for terzenta

In your count function, you have two basic approaches. 1 - Run through string 26 times, each time counting the occurrence of the corresponding letter. Keep track of the letter that has occurred the most. 2 - Run through the string once, incrementing counters stored in an array for each …

Member Avatar for terzenta
0
92
Member Avatar for Wolf CCMLG

I think those instructions are pretty clear. Create a class, that is derived from the string class. You will have to create your own constructor(s), the encryption method, and ideally input and output methods. See below for a general framework [code] #include <iostream> #include <string> using namespace std; class myString: …

Member Avatar for Alex_
0
904
Member Avatar for Der_sed

Works ok for me. And I see nothing about the search code that seem to cause any problem.

Member Avatar for vmanes
0
114
Member Avatar for serkan sendur

And I'd like to know why one of the hits I'd least like to see is now the first listed - arghhhhh! It's a site that hasn't had an update to my info in over three years. That one used to be buried on the second or third page.

Member Avatar for vmanes
0
208
Member Avatar for daviddoria
Member Avatar for StuXYZ
0
276
Member Avatar for johndoe444

if (rand() < RAND_MAX/(h->N+1)) If you read the work closely, you know that N is the data member of the node that counts its descendants. Lets use N=10 as an example. The probability of assigning new node at the root will be 1/(10+1), or 1/11 (approx. 9%). To determine that …

Member Avatar for johndoe444
0
142
Member Avatar for GooeyG

Look at where the first error occurs - is the variable aI in scope there? What's wrong with this pair (prototype and implementation)? [code] static double modifyInterestRate(); void Savings_Account::modifyInterestRate(double aI) [/code] Why are you using .print( ) the way you do, tacking it onto another method? Error 4 is probably …

Member Avatar for GooeyG
0
149
Member Avatar for jdam7459

To display the file contents in your command window, you need the command "type". See the following example use. [code] #include <iostream> #include <dos.h> using namespace std; int main( ) { char str[] = "myfile.txt"; //put your filename here char cmd[50] = "type "; //note the space at end! strcat( …

Member Avatar for marco93
0
132
Member Avatar for majestic0110

It's also said that married men live longer than single men. Actually, they live equally long. It just [b]seems[/b] longer to the married guys

Member Avatar for quicktpgo
1
268
Member Avatar for KernMilestone

Why do guys like girls that wear leather? They smell like a new car.

Member Avatar for quicktpgo
0
553
Member Avatar for Samyx
Member Avatar for VernonDozier
0
174
Member Avatar for icu222much

If you ran it by double clicking the .exe file, then it worked just as it should. The command window opened, displayed the output, then closed. Try opening a command window, navigate to where the .exe is, then run the program from the command prompt.

Member Avatar for hao001
0
207
Member Avatar for Der_sed

Additionally, your search function looks to be sort of a Binary Search - but rather odd in its implementation. I suggest you look up binary search algorithm, I think it might be hard to prove correctness of your method. Also, you return 0 upon success and 1 upon failure - …

Member Avatar for VernonDozier
0
94
Member Avatar for kreskin

Assuming there are no blank spaces, and all the data is on one line (no newlines in the data before the end)...you can use the comma as the delimiter in getline( ) to read in the text, then get your numeric values and ignore the commas, like so: [code] #include …

Member Avatar for kreskin
0
141
Member Avatar for wyett

Your problem lies here: [icode] for(int z=0; z<arraySize; z+3) [/icode] the statement [icode] z + 3 [/icode] does not change the value z. Perhaps you meant to say [icode] z += 3 [/icode] But that would not work well. z should be counting up by one, and your tests in …

Member Avatar for wyett
0
115
Member Avatar for Talguy

when passing the row from a 2D array to a function that takes a 1D parameter, use only the row index in your argument. [code] foo( test[0] ); [/code] That essentially passes a pointer to where that row begins.

Member Avatar for Talguy
0
99
Member Avatar for renzo2k3
Member Avatar for vmanes
0
98
Member Avatar for DJVK

If you bought it "used, from a company", do you mean that it was previously in an office environment? It might be set up to connect to a domain, which you are not part of. Right click My Computer | Properties | Computer Name tab. Is it part of a …

Member Avatar for Suspishio
0
80
Member Avatar for pinsickle

Firstly, using the >> method to read the student name assumes every student has a "one word" name, which is a bit unrealistic. If that is the condition of your problem, then consider [code] if( infile >> tempName ) { infile >> idNumber; // loading data from file for (int …

Member Avatar for pinsickle
0
156
Member Avatar for smco9

line 8 should have test [icode]index < length-1 [/icode] As VernonDozier mentioned, the proper version of this has the swap after the inner loop has found the one and only smallest remaining item. Doing the swaps inside the inner loop should still give correct result, but it will make the …

Member Avatar for vincent2085
0
188
Member Avatar for ANNICO

pay = hours worked multiplied by pay rate minus deductions It would help if you: a: more clearly/completely explained your problem b: wrote some code to solve the problem and point out where you're having difficulty. Welcome to Daniweb. Please see the sticky posts at the top of the forum.

Member Avatar for vmanes
0
25
Member Avatar for arbrophy

[QUOTE=arbrophy;966333]I'm using Visual Studio 2008 and I don't see the 'Advanced' option in the properties menu. Is it hidden somewhere else?[/QUOTE] You realize you're responding to an old response to an even older thread? Better to start your own, you can refer to the past discussion. Here's what you should …

Member Avatar for arbrophy
0
124
Member Avatar for Miganders
Member Avatar for pnkanchi

That's an OS created volume serial number. From the OP's question, I gather he wants the hardware serial numbers. This isn't really a C++ question, more an operating system one. That said, which Windows 64 bit - XP, Vista, Win7? Try SiSoftware's Sandra 2009 - it's 64 bit compatible, and …

Member Avatar for pnkanchi
0
252
Member Avatar for roberto usu
Member Avatar for vmanes
0
100
Member Avatar for Se7Olutionyg
Member Avatar for vmanes
0
145
Member Avatar for thebluestar

I've always been partial to Partition Magic, at least on systems up through XP. It allows you to resize all partions, essentially taking space from D and adding to C, moving the files as needed.

Member Avatar for Bob_180_Bob
0
111
Member Avatar for vmanes

It's so easy to just beat a program into submission - keep hitting the compile button and let the system find your mistakes, work at them one at a time. But [URL="http://xkcd.com/371/"]machines have feelings, too[/URL]! Learn the age old art of "[URL="http://ironbark.bendigo.latrobe.edu.au/subjects/PE/2005s1/other_resources/desk_check_guide.html"]desk checking[/URL]". Your compiler will thank you for it.

Member Avatar for Narue
1
99
Member Avatar for coud_ren_26

If you want it in the "like new" condition, you will have to format and reinstall the OS, because once you start using it, stuff gets added. If you're concerned about removing any traces of files you've deleted but keeping the ones you still have active, look for a diskwipe …

Member Avatar for kaninelupus
0
160
Member Avatar for vmanes

For those who have owned British cars or bikes this is a good twist on an old story. ELECTRICAL THEORY BY JOSEPH LUCAS Positive ground depends on proper circuit functioning, which is the transmission of negative ions by retention of the visible spectral manifestation known as smoke. Smoke is the …

Member Avatar for GrimJack
0
148
Member Avatar for gopi17

Two problems in one statement. [code] game[x][j]=='X'; [/code] First, you're using the equality test ( == ) instead of assignment ( = ). Second, you're trying to assign a character to an integer variable. This will work (when you fix problem 1) but will not give you the result I …

Member Avatar for vmanes
0
117
Member Avatar for ihatestarch

Ouch - I'm getting a headache just thinking about a recursive 2D function - but it is a technique used in maze running problems. Your main concern is determining your base case and determining in what manner you will modify the parameters in the recursive call. Concerning the array parameter, …

Member Avatar for ihatestarch
0
2K
Member Avatar for slfisher

It's work time. If the employee chooses to goof off during that time, that's a disciplinary matter. And....15-30 minutes to boot?

Member Avatar for DigitaLink
0
265
Member Avatar for Techwriter10
Member Avatar for Techwriter10

I don't suppose that JC Penney is really, covertly, behind the ad? All the legal fussing and fuming is for the stockholders' benefit (don't want them thinking the brand's gone rogue), all the while every legal bombast brings the ad to people's attention even more. Despite being pulled, one can …

Member Avatar for Techwriter10
0
118
Member Avatar for newsguy

Similar wording is in many of the Apple licenses, including iPods and iPhones. Now there's a threat, as seen at : [url]http://gizmodo.com/5016947/berkeley-group-uses-iphone-to-control-uav-squadron[/url]

Member Avatar for vmanes
0
293
Member Avatar for xfreebornx

First look at the discussion [URL="http://www.daniweb.com/forums/thread215615.html"]in this thread[/URL], which as of this writing is right below yours. Then write some code, post it, and we'll go from there.

Member Avatar for xfreebornx
-3
453
Member Avatar for power_computer

You're on the right track, but not really moving all the songs following the deleted item up. You only move the i+1 element to the i postion when the match was found. Everything past that will remain where it was. That is, if the list is 1 2 3 4 …

Member Avatar for emirpp
0
789

The End.