5,676 Posted Topics
Re: You'be been told before about [formatting your code](http://www.gidnetwork.com/b-38.html) properly. | |
Re: NEVER use the word **urgent** in a forum. There is no urgency as far as we're concerned. And many people will simply ignore your post. And you need to be more specific than "*it doesn't work*". If you want help, and fast, the more we have to stare at 300 … | |
Re: Why is it so hard to **explain** what is wrong for you noobs? We are programmers, not psychics. **Tell us** what you need help with! | |
Re: And we're supposed to read 309 lines of uncommented, unformatted code and do what with it? Try adding more output statements at key places (top/bottom of functions, in loops) to pinpoint where the problem is. And [format your code](http://www.gidnetwork.com/b-38.html) properly. If I have to read it, I have to be … | |
Re: > I get a bunch of errors and dont really know what to do. Any suggestions? Sure. Fix them. The errors tell you what line number and what the problem is, so look there and correct it. | |
Re: Don't apologize for sloppy coding. It only takes a minute or two to fix formatting. Why is it so many people think that seeding the random generator should be done immediately *before* calling `rand()`? Doesn't anyone read the info about how `srand()` works? Why do you have all those arrays … | |
Re: Since **The Dragon** closed this thread 5 years ago, I'll close it now. | |
Re: Actually, [formatting the code](http://www.gidnetwork.com/b-38.html) is the first step. The second step is fixing the compile errors. | |
Re: You only read the file once and you're done. What do you need to read more than one record? | |
Re: How do you know the open file worked? You never checked for errors. | |
Re: OK. What syntaxes? | |
Re: Start by opening the comiler's IDE. Then add `#include <iostream>`. You can continue from there. | |
Re: You have 2 questionable sections. All those strings are defined at least twice. You should make a master list of the strings and use when you need one, use an index into the master list array. By carefully designing the list, you *may* (not guaranteed) be able to make your … | |
![]() | Re: Don't use `exit(0)`. Use `return 1`. I don't understand the problem you are having. The instructions you posted literally tells you all the code you need to use, most of the variable names and what they are for. The only thing you have to figure out is a) how many … |
Re: And [format your code](http://www.gidnetwork.com/b-38.html) properly so we can understand it. | |
Re: > When you want to enter a sentence ( that is spaces will be present ) , use fgets(). Don't you mean `cin.getline()`? This **is** C++... | |
Re: Format your code properly with code tags and finish your [I]for [/I]statements (3 parameters, not 2) and repost... Then we have something readable to work with. | |
Re: > but i keep getting these errors in my program. What errors? I don't see any errors posted at all. | |
Re: All you need to do is read the character and output the same vaoue in hex format. There are no calculations necessary. > This could all be horribly wrong because I have taken a lot of this from different forums and webpages all over the web. If anyone has any … | |
Re: `for (int j = 0; j<strlen(tmpStr); j++)` Why are you going through *tmpStr*? Isn't that simply the string you used on input? It has no bearing on your word list once input is done. | |
Re: The statement `if (!string || !*string || !isdigit(*string))` alone tells me you have no idea how to handle an array of characters. You need to read up on 'strings' and pointers to understand them. Then what you need to do should be clearer. | |
Re: No. It needs to be in the project directory -- where the .EXE lives. Using `puts()` -- BRAVO!!! Finally someone who doesn't use `printf()` :o) Using `main()` -- Oops. `main()` is an *int*. Always. | |
Re: You can't read a string (%s) into a single char (*name[i]* and *pid[i]*). You need to define them both as 2D arrays, *names[Number of names][number of chars for each name]* | |
Re: > Does this mean that I have to find alternative functions to the ones mentioned in the book? No. You need to read closer. You should find that he provided code for these functons. | |
Re: > The element I am assuming is the pivot point? No, it's not a pivot point. It's just a number you need to find. > Basically I am asked to find an element in a sorted array and that is it. What element? You don't seem to be looking for … | |
Re: Yes we can, if you help us understand your difficulty. All it takes is a FOR statement and the % (modulus) operator. | |
Re: [QUOTE=lovetwins01;385032]By the way, I'm still not sure if I followed the correct guidelines for piosting code. Please advise me if I have done something wrong. Thanks in advance.[/QUOTE] Nope. Problem 1: You didn't use CODE tags as the background of the input box advises. Also [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]here[/url] Problem 2: [url=http://www.gidnetwork.com/b-38.html]Formatting code[/url] … | |
Re: Where did you > "Implement a separate function to reverse the order of the array using call by reference. The input of this function should be two pointers (pointing to original array and reverse array). Without an attempt at this implementation, there's nothing to help with. | |
Re: Look you the **is\*\*\*()** functions -- isalpha() isdigit() ispunct() etc... They are in the *ctype* (or *ctypes*, I can never remember) header | |
![]() | |
Re: FYI, it would be easier to tell if the value was loaded properly if you print using HEX (%X) instead of integer (%u). Food for thought. > I have tried to make a chart of how the unsigned int should look at the end, if its wrong than my understanding … | |
Re: Where are you dividing? Just before those statements, output the values used to figure out the denominator. For example, for line 43, display **i** and **a[i][i]** Now figure out what that value *should* be and why it is zero. | |
Re: > Why bother with approximations? What is the purpose of inexactitude for this? It's obvious. 1) It's part of the assignment to get the grade 2) It shows a possible approximation of the temperature conversion 3) Teaches how to calculate a percentage error via program Many times there's more to … | |
Re: > So,please tell me how do I store value of the first roll and compare it with the next move(s). I tried something, but it does not seem to work. The same way to do it with any value -- create a variable to store the first roll and use … | |
Re: I don't understand. You rememberd the number of wins and losses, therefore you saved them somewhere. I think you need to explain in much more detail what you're confused about. | |
Re: 1) indent better so we can read the code easier. 3 to 4 spaces is normal. 2) print your code and grab another piece of paper and a pencil. 3) sit at your desk and start at the top of your code and start writing out all the variables (including … | |
Re: > error C2676: binary '+=' : 'IloNumVar' does not define this operator Whatever **IloNumVar** is, you cannot do a **+=**. It's obviously not an integer. | |
Re: I see 6 functions. Based on both your threads, it's time to dust off the: **[boilerplate_help_info]** Posting requests for help must be well thought out if you want help quickly and correctly. Your post did not meet the criteria for quality help. You may get some posts, but are they … | |
Re: Many of us ignore any posts with URGENT or ASAP. They indicate to us posters that think their problems are more wothy of help than others, and, to us, there is no urgency at all. But aside from that (don't do it again) you need to ask better questions. You … | |
Re: Let me see if I understand this. Player 1 rolls the dice. -- If he win (7/11) game ends. -- If he looses (2) game ends. If neither, Player 2 rolls. They just keep passing the dice after one roll. Is that about it? Some current problems: 1) `srand()` can … | |
Re: Now you know why you should use variable names that make sense. Just choosing random letters obviously have drawbacks. | |
Re: `for(string::const_iterator iter = s.begin(); iter != s.end(); ++iter)`What does this line do? `string::const_reverse_iterator rit = s.rbegin();` What does this line do? What do the variables defined (*iter, rit*) point to or indicate. Why make pointer to the characters? Why not generate subscripts and just use them? | |
Re: > Can someone tell me why i get the error code "ISO C++ forbids comparison between pointer and integer" for lines 135 and 149 135 is `for( int i = 0; index < 12; i++)` 149 is `for( int i = 0; index < 12; i++)` You need to make … | |
Re: > Dani: Not just India. That's what I was taught to use too! How long ago was that? |
The End.