1,362 Posted Topics
Re: 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. | |
Re: 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. … | |
Re: Please show the full function in which that occurs. One line out of context can be hard to debug. | |
Re: 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 … | |
Re: 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. | |
Re: 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> | |
Re: 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 … | |
Re: [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 … | |
Re: 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] | |
Re: I think you'd probably go mad once you see what a bunch of mush most minds are, especially those of politicians. :twisted: | |
Re: roaming profile; network login, basic security? Are you looking for the name of a specific system, like Novell Netware, MS Active Directory? | |
Re: 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. | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: setw( ) is your friend for getting columns lined up nicely. | |
Re: 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. | |
Re: 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. … | |
Re: 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. | |
Re: 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 … | |
| |
Re: 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)? … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. … | |
Re: 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 … | |
Re: 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? | |
Re: 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 … | |
Re: 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] ? | |
Re: 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.) | |
Re: Here's the [URL="http://tinyurl.com/d73ep4"]Microsoft Product Key Update Tool[/URL] | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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( ) … | |
Re: 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 … | |
Re: As Robin Williams said, "Reality - what a concept!" | |
Re: 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. | |
Re: 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( … | |
Re: [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 … | |
Re: 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 … | |
Re: 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? | |
Re: [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 … | |
Re: 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? | |
Re: Please don't start a new thread that asks the same question as your previous one. Look there for an answer. | |
Re: 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 … | |
Re: 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 … |
The End.