5,676 Posted Topics
Re: It all depends on what line 36 looks like with your change. | |
Re: Your basic problem is if you don't know how to use something, you can't program it. Any algorithm you try to use in a program you need to understand. Sit down with paper, pencil, and a good description of the principle and work out how it operates. Be sure to … | |
Re: Because when you enter a character, rather than checking if the character is a vowel first you enter a loop. Then you check if it's a vowel for each and every letter in the puzzle. So, why enter the loop if the character entered is wrong? | |
Re: Of course you need help. Isn't that obvious? But [I]you[/I] need to give a very specific set of guidelines about [I]exactly[/I] what you need. What "algorithms"? Based on your almost description above, check each character input and create variables for [iCODE]num1[/iCODE], [iCODE]num2[/iCODE], and [iCODE]operation[/iCODE]. Then test the operation and perform … | |
Re: I don't speak alien language. Also, without knowing what went wrong (you didn't explain the problem at all) what can we say? Maybe you should try reading one field and see if that works. If it does, read one more field. Keep adding until one full line is read. | |
Re: You know you can't define a function within another function, don't you? If you properly [url=http://www.gidnetwork.com/b-38.html]format your code[/url], the error will jump out at you immediately. | |
Re: What's the value of [B]CreditDebit[/B] at the beginning of the [iCODE]while[/iCODE] statement? | |
Re: Without even looking back I remember someone pointing out that you are destroying your loop counter [B]a[/B], so naturally the outer loop is broken... | |
Re: Because a letter cannot be put into an integer so the read fails. When you loop back, the letter is still there, so the read fails. When you loop back, the letter is still there, so the read fails. When you loop back, .... Why do you need an actual … | |
Re: Depends on what you need help with. Care to tell us what's going wrong? | |
Re: Strings and character arrays cannot be typecast as values. They can only be converted. Look up string to number conversion techniques. | |
Re: Look at [iCODE]kbhit()[/iCODE]. With that, [iCODE]getch()[/iCODE], and a timer you can do what you need. | |
Re: You've got the idea. Read the line. Find ". Start copying until you see another ". Find next ". Copy again until... | |
Re: [B]Andre[/B]! No formatting and a full blown answer?!? How could you? | |
Re: Based on the code, it doesn't compile. Either explain the real problem or post the correct code. You can't 'skip' a line. Just read it and ignore what you read. | |
Re: Care to elaborate, or do you really want us to search through 200 lines of code not knowing what we're looking for? When asking for help, details are important. | |
Re: Create two counters. First counts the rolls. Assuming heads, second gets set to 0 on each tail, incremented by 1 on each head. When second matches the number entered, first counter is number of rolls it took. | |
Re: Help with what? When asking for aid isn't it a good idea to describe the problem? We ain't the psychic programmers... | |
![]() | Re: BGI graphics was designed for earlier Borland compilers and won't work with 5.0+. So you have to rewrite the output portions of the program to remove the screen manipulation. Or you can find a graphics package you like and rewrite the output sections. |
Re: It would help if you'd describe the problem. Getting stuck is not an explanation. | |
Re: [I]orderNumber [/I] is a char variable so it's value will be '1', '2', ... '9', not 1, 2, ... 9. If you need it to become an integer, subtract '0' and it will be correct. | |
Re: [QUOTE=Sam56] How would one properly format the block of code with only one cout? I think it has something to do with the semicolons? Any help here?[/QUOTE] By using CODE Tags :icon_twisted: Since semi's [I]end [/I]a statement, don't use them: [CODE] cout <<"hello" <<"how ya doin?" <<"goodbye."; [/CODE] | |
| |
Re: I saw him a couple times live. I hear when his brother took over the show it wasn't quite as good although I never saw him. Trivia question: What is Gallagher's first name? | |
| |
Re: Not really. By it's very nature the food in the US is only mediocre on the health level in the first place. Overused land makes the nutrients and vitamins in vegetation low. By the time you get the veggies home from the market, most of the nutrition has leeched out … | |
Re: Don't be so vague. Tell us exactly what's happening, not a generic "it doesn't work" | |
Re: Two answers, since your description leaves too much out so it's hard to understand your problem: 1) Since the movie information should go into an array of structures, you don't need any spaces between anything. 2) [iCODE]cout << " ";[/iCODE] And please [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. It's very hard to follow. | |
Re: That's because you're breaking out of the loop after 16 characters. Instead, when you hit 16 1) reset the character counter 2) output the ENDL | |
Re: First, your open is fine. [B]Adak[/B], he's using [ICODE]argv[/ICODE] to open the data file. Second, [B]sree_ec[/B] is correct. Third, when you use [ICODE]fgets()[/ICODE] to read 2 characters, the array must be of size 3. Remember (or look it up), [ICODE]fgets()[/ICODE] always adds an ending \0 and reads length-1 characters. | |
Re: What's the formula for a cosecant? Why would they need to add a special function when you can easily use the definition formula? | |
Re: Does your draw cone function consider the width of the rocket? | |
Re: 1) Use CODE Tags 2) Format your code -- [url=http://www.gidnetwork.com/b-38.html]see this[/url] 3) [ICODE]main()[/ICODE] is not a void function -- [url=http://www.gidnetwork.com/b-66.html]see this[/url] 4) Execute your loop with pencil and paper to see what it's doing. Concentrate on the IF statement as you do. | |
Re: Yes we can. But we are not coding slaves. It's your problem, not ours. | |
Re: [url]http://en.wikipedia.org/wiki/Floating_point[/url] | |
Re: Since we aren't in you head, it's really hard for us to know where you're going. The only thing I can really tell you is your set functions should not input values. They should only set the private var with the value passed into the set-functions. Do the input in … | |
Re: Use [iCODE].rfind()[/iCODE] to search for the last space. [iCODE].rfind()[/iCODE] starts searching from the end of the string. | |
Re: I wouldn't put it in that pattern. I'd format the code so it can be read by others. | |
Re: The C++ Standard requires [iCODE]main()[/iCODE] to be [B]int[/B]. [B]void[/B] is just plain wrong. | |
Re: It says the error is in main on line 61. Might be a good idea to show us that line. Also [iCODE]string filename = Work.Title += ".txt";[/iCODE] should be [iCODE]string filename = Work.Title + ".txt";[/iCODE] I believe. I doubt you want to change [I]Work.Title[/I] | |
Re: Answering a C question with C++ is worthless. And using gets() and getch() is so wrong it's close to criminal. And do I really need to mention CODE Tags? The Member Rules are quite clear... | |
Re: [QUOTE=skiabox;]This is a solution but it does not work at all times and I can't find a logical flow in the code. Any ideas?[/QUOTE] Output key values during the execution to see if the program is behaving as you think it is. Try to pinpoint the area you have the … | |
Re: Since the lines in question are 52 and 256, and you posted only 40 lines, it's impossible to tell. | |
Re: It just doesn't work? Then you did it wrong. When asking for help, be specific. What [B]does[/B] it do instead? And try to pinpoint [I]where[/I] the problem might be. Did you add output statements to see if important steps of the process have done their job correctly? | |
Re: In other words, add the line [iCODE]using namespace std;[/iCODE] after your header. | |
Re: Start by reading the first file and displaying the line Next, search for the "CCD" Then copy the rest of the line to another string Now display that new string to be sure you extracted it correctly Repeat until you get to the end of the file. | |
Re: Because floating point numbers are approximations. Digital values cannot represent real numbers exactly. Search the web for explanations of how they work. |
The End.