1,362 Posted Topics

Member Avatar for Ellisande

You might try the find_first_of( ) function to locate any word separators. Knowing where a word begins and ends, you can then use a substring function to extract it to a string that you will modify.

Member Avatar for Ellisande
0
120
Member Avatar for zachman1094

Start by looking at what's in the Startup menu - delete what you don't want. If you're handy with Regedit, you can look in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run and HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run Delete any programs you're sure you don't need. I start with all the automatic update schedulers that so many programs want to launch. …

Member Avatar for caperjack
0
371
Member Avatar for daviddoria

Please show the full function in which that occurs. One line out of context can be hard to debug.

Member Avatar for Narue
0
311
Member Avatar for rickster11

Leap year is a little bit more complex. If year % 4 == 0 , but, if year % 100 == 0 it's not, unless year % 400 == 0. That is, only every fourth century year (every 400 years) is a leap year. Perhaps an approach would be to …

Member Avatar for vmanes
0
95
Member Avatar for pagu

You say you process it several times. Do you attempt to read in the full file, process it, add to it, then write a new, larger file? Perhaps showing us pertinent portions of the code would help.

Member Avatar for nucleon
0
108
Member Avatar for cppStudent

And, as an aside, you could update your use of the following libraries: #include <stdlib.h> #include <math.h> should be #include <cstdlib> #include <cmath>

Member Avatar for Agni
0
86
Member Avatar for blackbyron

My crystal ball needs new batteries, so I really don't know what you're trying to do, or what your assignment is asking you to do. Just looking at this bit of code, each of the three functions are setting the same class member "gallons" to 0, regardless of what value …

Member Avatar for blackbyron
0
97
Member Avatar for sid78669

[quote]which makes no sense as getline will always return a string 10 characters shorter than line. [/quote] How do you know this? Actually, this is hard to figure out as you're not telling us a lot of other stuff. You have a function call to [icode] getLine( )[/icode] - what's …

Member Avatar for sid78669
0
193
Member Avatar for SouthSeaPirate

What's your budget? I'd expect most such products that work over the network will be commercial, that is, $$$ products. I use Belarc Advisor for personal purposes. They make a network product, it's kinda pricey. [url]http://www.belarc.com/belmanage.html[/url]

Member Avatar for caperjack
0
135
Member Avatar for Mushy-pea

I think you'd probably go mad once you see what a bunch of mush most minds are, especially those of politicians. :twisted:

Member Avatar for vmanes
0
79
Member Avatar for staticuky

roaming profile; network login, basic security? Are you looking for the name of a specific system, like Novell Netware, MS Active Directory?

Member Avatar for SouthSeaPirate
0
103
Member Avatar for catboytm

Does the limited CPU power occur when the machine is running on AC power? I found that Compaq's defaults on mine had it limited to 50% CPU on battery but 100% on AC.

Member Avatar for catboytm
0
109
Member Avatar for Kainan54

First, if you have a separate video card, make sure it's seated correctly and that all cables are tight. Has the computer or monitor been moved recently, that might have loosened or broken a connection? The beeps can mean several things - it depends on the make of the computer …

Member Avatar for Godsp3ed
0
123
Member Avatar for ellimist14

Don't put the keyword "void" in front of the function calls. Just use the function name. [code] printHeader (fout); printReport (fout,commission, salesID, employeeCode, numUnits, numDollars, n); [/code]

Member Avatar for nucleon
0
153
Member Avatar for Takafoo

Why does your isPrime( ) function return true when the number is divisible by 2, and returns false in every, repeat EVERY, other case? Look at it closely.

Member Avatar for vmanes
0
123
Member Avatar for iTsweetie
Member Avatar for confused!

And I'd like to point out that hajiakundov and siddhant3s have both not helped confused! to learn. Giving answers only gets the assignment done, but does not promote learning how to do the assignment. Please read the stickies at the top of this forum.

Member Avatar for hajiakhundov
0
269
Member Avatar for boydale1

How do you use them? Consider how the C++ string works. When you assign some content to the string, it allocated enough memory to hold that, plus usually a little extra. Length will tell you how many characters are assigned (like strlen( )), capacity tracks the amount of memory allocated. …

Member Avatar for boydale1
0
122
Member Avatar for songweaver

Without a loop, there's no way you'll get back to the choice option - it will become a one pass program. From the standpoint of a continually running program, you need a third option - Quit. That choice (say, 3) should be what controls the loop.

Member Avatar for MosaicFuneral
0
275
Member Avatar for pdwivedi

sizeof( colour ) probably isn't going to work. The sizeof( ) operator only gives the size of the array in the function where the array was declared. All you are likely to get here is the size of a pointer. Whether the string colour is char array or std::string, I …

Member Avatar for Ancient Dragon
0
201
Member Avatar for The Dude
Member Avatar for monolith45

Your question is not very clear. What do you mean by "this needs to be floating" and "without knowing the float code for calculation"? That the sales tax rate can vary? Or that you need to use a floating point value (which can be of type float or type double)? …

Member Avatar for vmanes
0
142
Member Avatar for ward.605

Your original sort is correct, if a bit odd. As pointed out, you were calling it incorrectly, putting the [] after the array argument. Just use the array name as an argument. Please use code tags to enclose your code. That makes it easier to read, as your indenting will …

Member Avatar for vmanes
0
90
Member Avatar for Duki

It would help if you told us exactly what the error message was. I think I see a couple flaws in the logic of this. 1 - If two dequeued objects are not equivalent, you return false to the previous instance of the function, and those two items do not …

Member Avatar for Duki
0
179
Member Avatar for arshad115

The warning about gets( ) is just a warning that it's going to be deleted in future verisons of the compiler because it is an unsafe function - it doesn't guarantee not to overflow the destination array. Why are you using it? Why not continue using getline( ) ? To …

Member Avatar for vmanes
0
156
Member Avatar for arshad115

This an awfully ambitious assignment to not allow structures. To do this with just the arrays, you'll probably need a few different data elements. You need to know the status of all rooms, to include their costs and available/occupied status. Secondly, you need to track the customers and their information. …

Member Avatar for vmanes
0
170
Member Avatar for JameB

There is no direct way to know how much content you have in an array, versus the size of the array. Except, of course, when your array is of type char and you are using it properly for strings. Consider an array of integers. Just because some element has a …

Member Avatar for arshad115
0
160
Member Avatar for apch01

Also, the prototype for the display function should be outside of main( ), after the struct definition. The display function doesn't return any useful value, so why not make it a void function?

Member Avatar for apch01
0
69
Member Avatar for mguj1130

Draw a picture of what you're doing. You are putting the input number into array starting at index 0, putting highest valued digit there. What happens when you try to add two numbers of different length? You'll add the tens to the hundreds, or some such. Also, you are reusing …

Member Avatar for vmanes
0
680
Member Avatar for ahihihi...
Member Avatar for dvsConcept

do you have #include <string> ? This is a problem [code] if(reelArray[i] == (reel1 - 1)) [/code] You're comparing a string to an int - not gonna work, not making any sense. Do you mean to be comparing reelArray[i] to reelArray[reel1] ?

Member Avatar for dvsConcept
0
700
Member Avatar for dirt14

I must live a sheltered life - I'd not seen those before (well, the dog through the flaming hoops I'd seen, but not the lead in photo.)

Member Avatar for vegaseat
0
50
Member Avatar for patelrg
Member Avatar for caperjack
0
524
Member Avatar for moshe12007

Please use this big empty space to provide more details of what you're trying to do. Your title doesn't really say that much.

Member Avatar for vmanes
0
256
Member Avatar for Mossiah

A couple other comments. By declaring the strings in global space, they get set to all 0's. When you reverse the string, you get a valid string because there are NULL terminators in the destination. If you declared the strings inside main and passed them as arguments to the function …

Member Avatar for vmanes
0
111
Member Avatar for The Dude

67% seems common here! Me too. Or is that, "Me, too?" As to apostrophe in the "four yards worth" question, yep, that seems valid, as found on several other grammar sites. Proper place in this use is after the s, since it's a multiple quantity. In real life writing, I …

Member Avatar for almostbob
0
316
Member Avatar for TheBeast32

The compiler is aligning the struct elements on word (4byte) boundaries, thus the two empty bytes between your char's and the next element. You might look up what the pack pragma will do for you, or other compiler options.

Member Avatar for TheBeast32
0
103
Member Avatar for songweaver

You missed it by one closing parenthesis. Your code: [code] x = floor( x * pow(10.0, n) + 0.5 / pow(10.0, n)); [/code] multiplies the number by a power of ten, then adds (.5 divided by that power of 10). That whole quantity is then passed to the floor( ) …

Member Avatar for kbshibukumar
0
142
Member Avatar for cbreeze

When you read from the file, you're storing to a null object [code] publicOfficial* newOfficialPtr; while (!numdata.eof()) { newOfficialPtr = new publicOfficial; getline(numdata, headOfficialPtr->name); getline(numdata, headOfficialPtr->sob); numdata >> headOfficialPtr->officeHeld; [/code] Why are you storing to headOfficialPtr->........ ? Also, once you get that worked out, you'll find your loop control is …

Member Avatar for vmanes
0
135
Member Avatar for GrimJack
Member Avatar for Mossiah

Write your function to take a parameter that is a char array. When you call the function, use only the char array's name, no indexing. When you've done this, please show the code and we'll provide further assistance.

Member Avatar for monkey_king
0
66
Member Avatar for h3llpunk

Only call srand( ) one time in your program. As fast as this code executes, you are probably going to get the same value for both dice. Why call rand( ) 100 times, storing the value to random_integer, then (incorrectly) storing that to pdice1 and pdice2? Just call the rand( …

Member Avatar for vmanes
0
88
Member Avatar for power_computer

[QUOTE=power_computer;816371] yall guys fail at helping on here, I thought I would get good help but the only was demongirl you had to be a smartass thanks anyway[/QUOTE] Are you responding to this thread? You got two good, clear responses (none of which were from demongirl). If you're not going …

Member Avatar for vmanes
0
79
Member Avatar for urbandad70

We'll need a bit of clarification on the assignment. Is each row in the scores.txt file to be treated independantly? That is, for row 1, only five values are to be summed, averaged, etc? Then go on to row 2 (seven items), and so on? Are you guaranteed that the …

Member Avatar for vmanes
0
160
Member Avatar for ephums

for this kind of problem, you should pass the limit number to the function. Your recursive function calls itself with an a argument smaller that what it received, until the argument is eventually 1. What's [icode] (cin >> number).get();[/icode] this doing?

Member Avatar for siddhant3s
0
95
Member Avatar for anbuninja

[QUOTE=Ancient Dragon;812657]What you just posted is incorrect. You can not have the name of a parameter the same as the name of the function. You will get a compiler error on that. [/QUOTE] Actually, you can have the same name for the function and one of its parameters. The scope …

Member Avatar for vmanes
0
174
Member Avatar for hoho10

I think there's a good case to be made for prior art. Remember the [URL="http://oldcomputers.net/vic20.html"]Vic-20[/URL], for instance?

Member Avatar for vmanes
0
115
Member Avatar for tyoung4@runner

Please don't start a new thread that asks the same question as your previous one. Look there for an answer.

Member Avatar for tyoung4@runner
0
305
Member Avatar for tyoung4@runner

If you're still asking questions, why did you mark the thread "solved"? This bit [code] //Input validation for (hours = 1; hours <= mph; hours++) { if (mph < 0 && hours < 0) { cout << " Enter a positive number for mph and a value more than 1 …

Member Avatar for tyoung4@runner
0
267
Member Avatar for lancevo3

I think your convPunct( ) should return any character that's not caught by the switch cases in its unchanged state. Either use the switch's default: or have a return statement after the switch. Remember that ispunct( ) will be true for all punctuation, not just the 10 particular ones you're …

Member Avatar for vmanes
0
129

The End.