5,676 Posted Topics
Re: A letter is just an integer value. 41 = '1', 65 = 'A', 97 = 'a'. It all depends how you display the value, as a character or as an integer. 1) Do not edit a post [I]after[/I] someone responds to it. It makes their response seem wrong. 2) [iCODE]fflush(stdin)[/iCODE] … | |
Re: [b][boilerplate_help_info][/b][code] 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 going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: [b][boilerplate_help_info][/b][code] 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 going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: Advice #1: Reformat so the code is readable. Your indenting makes the code unreadable. [url=http://www.gidnetwork.com/b-38.html]See this[/url]. | |
Re: Read the [I]entire line[/I] as a string and look at the input character by character. You post your code that shows your attempt and explains what happened. Then we will help you make corrections. | |
Re: [QUOTE=learner guy;]plz see if my validRook algorithm is correct[/quote] It helps if your ask a specific question about your code that we can answer. Just asking us to check if your algorithm is correct by reading code is difficult -- at least from a beginner's code. It's best to 1) … | |
Re: It's because when you enter [B]Y[/B] or [B]y[/B] aren't you also pressing [B][enter][/B]? You are leaving the [B][enter][/B] in the buffer for the next input statement. You need to clear your buffer. I leave that exercise for you to search out. A couple problems, though: Never call [iCODE]srand()[/iCODE] inside your … | |
Re: [b][boilerplate_help_info][/b][code] 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 going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: Yes, a 'string' already is a character array -- by definition. | |
Re: Your C syntax is completely wrong. Nowhere in your code do you even attempt to find the 2 highest marks. | |
Re: [QUOTE=d.h.2011;1697366]Hi, I need to do a depth first search tree for the following undirected graph: [CODE] 1-2-3 | | | 4-5 6 | | 7-8-9 [/CODE] (Sorry about the graph being so unclear, the dots are just to space the lines out). It says to start at A which I'm … | |
Re: [iCODE]srand()[/iCODE] must be called [I]only once[/I] -- at the beginning of the program. | |
Re: I don't see any errors. If you do, you might want to explain them. | |
Re: Bad code posted for no apparent reason. Should this thread be deleted? | |
Re: With what? We have no idea what you've done! [b][boilerplate_help_info][/b][code] 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 going to be useful? Check your … | |
Re: Try outputting the words immediately after you input them. | |
Re: You will also find it easier if you fill out the [I]tens[/I] array so you don't have to do any math to get the correct subscript: [CODE] char* tens[] = {"---", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}; [/CODE] Now when you get the tens digit [B]2[/B] it … | |
Re: [QUOTE=carolinatech;]Hey all, I have a question how would I go about perform a comparion for two boxes. I would have to find the length, width, and height of both boxes and compare the volume of them to see which box would have be larger.[/QUOTE] You've got the solution exactly... | |
Re: Never never NEVER call [iCODE]main()[/iCODE]. [B]NEVER[/B]! It's an entry point to your program not a normal function. Why call [iCODE]exit()[/iCODE] (twice) when all you need to do is [B]return[/B]? | |
Re: [QUOTE=Narue;]You may quote and reference Daniweb content, but you may not reproduce the content. The difference is that a quote is a relatively small part of an article written in your own words, and reproduction is a large scale copy/paste of our content with little or none of your own.[/QUOTE] … | |
Re: 1) Never use [icODE]goto[/iCODE]. Use a [iCODE]while[/iCODE] loop instead. 2) [url=http://www.gidnetwork.com/b-38.html]Format your code[/url] properly. It's difficult to follow and mistakes are made with bad formatting. 3) Always call [iCODE]srand()[/iCODE] once [I]and only once[/I], at the beginning of the program. 4) Never use [iCODE]system("cls");[/iCODE] while programming. It's hard to debug code … | |
Re: Are you supposed to A) input 10 numbers and not output duplicates? B) input numbers until 10 numbers are output? It's not quite clear. Another option to each of the above is to set an array of 101 integers (0 to 100). Zero them all. As you read in a … | |
Re: Please forget the good [B]Captain[/B]'s 2nd and 3rd explanations. Even [B]I[/B] would find them confusing if I was trying to learn loops. Just concentrate on his first example. | |
Re: Does what you have work? When that works well, what do you want to add next? | |
Re: There is not one error mentioned in the original post other than a vague "[I]output doesn't look right[/I]". Without any details, what can we say? ![]() | |
Re: Please, guys ([B]Schoil-R-LEA[/B] and [B]kjcjk[/B]), stop writing the code for people. [I]They[/I] need to figure it out, [I]we[/i] should point the way, but not fix the code. | |
Re: Make an array of 10 strings. Put each line read into this array. After you've read 10 lines, start overwriting the strings from string[0]. In other words: read line 1 --> load string[0] read line 2 --> load string[1] read line 3 --> load string[2] read line 4 --> load … | |
Re: Do not change [B]j[/B] inside your loop. All you need to do in the inner [B]j[/B] loop is: 1) Compare [B]b[/B] with the current [B]x[/B] value (you are doing this) 2) If less than, replace [B]b[/B] with the current [B]x[/B] value. That's it. | |
Re: [QUOTE=Raaz_mystery;]Hi Guys. My doubts are related to Brute Force Attack but let me Tell you first that it has nothing to do with the Hacking/Cracking. So please dont block/remove my Post on this Forum. I want to study more about Brute Force Attack because it is in my Subject (i.e. … | |
Re: [QUOTE=randolph.gamo;]hi guys i need help.[/QUOTE] Really? I was wondering why you joined. [QUOTE=randolph.gamo;]In fact it's an assignment.[/QUOTE] Really? Why else would you have come here? [QUOTE=randolph.gamo;]I'm fed up with this stuff.[/QUOTE] Really? Why do we care? Get to the point... [QUOTE=randolph.gamo;]This is my code.[/QUOTE] And nice code it is. Indented … | |
Re: You example and one of [B]L7Sqr[/B]'s example violates a very [I]important[/I] part of your task, namely: [QUOTE=beantine;]Ideally the data should be entered from the user using scanf (hence the int num within the function for a for loop)[/QUOTE] Why try to load the data in a different way? Just concentrate … | |
Re: Neither do we since we didn't write it and don't know know what else you want to do with it. | |
Re: Don't use Rich Text. Just read the fie in as normal text. Read in as much of the file as you can. Do your search. Since you have most if not all of the file it's now a simple matter to back up 20 lines and start printing. | |
Re: [b][boilerplate_help_info][/b][code] 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 going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: Change line 6 and 13. My psychic powers tell me the problem is there. | |
Re: [QUOTE=griswolf;]P.P.S. <rant>[B]Why[/B] are you using a raw array in a C++ class? (Yeah, I see what the prof says to do, but it is, in my opinion, a very poor use of your time and the compiler.) Introductory C++ should make much use of the STL and all the built … | |
Re: Error is on line 13 | |
Re: Major problems: 1) [B]Randomize[/B] should be used when the program starts, not when you click your button. 2) Never use [B]GOTO[/B], it's unnecessary and in your case does nothing worthwhile. 3) In line 13, how can [B]luckyno = arrayno(check)[/B] since [I]arrayno(check)[/I] has no value? 4) And through whatever magic might … | |
![]() | ![]() |
| |
Re: [b][boilerplate_help_info][/b][code] 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 going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: Why are there so many worthless posts here? The answer is extremely simple: There is no function (why would there be?) Use = on 2 consecutive characters. [QUOTE=zeroliken;]Here's the answer plus it has a string function[/quote] We don't [B]give[/B] answers here. We help them [B]fix[/B] their attempt. As for your … | |
Re: [b][boilerplate_help_info][/b][code] Posing 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 going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: Concatenate "C:\\wmplayer.exe " and [I]fname[/I] into a char* and use that variable. | |
Re: [QUOTE=Ancient Dragon;]concatenate the two strings before calling system [QUOTE=slygoth;]PERFECT thanks a million[/QUOTE] [/QUOTE] Gee, what was it I said? Oh yeah, [QUOTE=WaltP;]Concatenate "C:\\wmplayer.exe " and [I]fname[/I] into a char* and use that variable.[/QUOTE] :icon_rolleyes: | |
Re: Depends on many things like: what's in the file? where the file is? is it protected? is it encrypted? is is broken? is it locked? | |
Re: I'd start by learning to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] properly. Then understand that [iCODE]main()[/iCODE] has never been a [I]void[/I] function. [url=http://www.gidnetwork.com/b-66.html]See this[/url]. Further know that [I]conio.h[/I] and [iCODE]getch()[/iCODE] are nonstandard and should not be used. There are [url=http://www.gidnetwork.com/b-43.html]standard ways[/url] to do what you are trying to do. And last, what makes … | |
Re: 1) count the number of characters and when you hit your magic number output a \n 2) call [B]srand()[/B] [I]only[/I] at the beginning of your program, never in your function | |
Re: When you enter numbers (like your [I]doubles[/I]) the [B]ENTER[/B] is left in the input buffer, since it's not a number. You need to clear it before reading a string or a character. Look into the [I]cin.ignore[/I] method. |
The End.