5,676 Posted Topics
![]() | Re: Follow the **Dragon**'s suggestion. Ignore **SRE93**'s |
Re: Read your condition `while(n<=5) cout error` out loud and listen/think about what you're saying. Does that condition do what you want? | |
Re: Look at each character until you find the first character in the find-string. Then check the following characters with the rest of the find-string. If a mismatch is seen, you haven't found a substring. Continue looking, starting where the first character was found. | |
Re: Expanding on **MNeal**'s post, stop using *magic numbers*. If you want to test for the character 'A', use 'A', not 65. Zero is '0', not 48. | |
Re: > When pasting code, all you need to do is highlight it and either click the Code button or hit the Tab key on your keyboard. And if manually typing code into the editor, it preserves your indentation level like a real IDE would. It's actually EASIER for me to … | |
Re: 1) I don't see where you are displaying the size of the buffer, only the size of the file from `ftell()`. 2) The calculated size of the file from the copy function is lost so you really have no idea how big the buffer is. 3) The buffer you allocated … | |
Re: First question, what does EOF have to do with this problem? The solution has to do with being able to read non-digit characters without causing an error. Search for the thousands of responses to this error using "*scanf integer character input*" | |
Re: >but I cannot get the words with consonants to translate correctly. I have seen lots of examples on here of Pig Latin programs, but they don't seem to follow the type of parameters that we have to use for this class. Any help would really be appreciated, as I have … | |
Over the past couple days I've marked ModPlace and Feedback Forums as READ several times and still get 'NEW' posts.  | |
Re: When you read using `fgets()` and the line is longer than the buffer size (or bytes to read) the *next* read will continue where the last read left off -- in the middle of the line. | |
Re: So migrate to a **real** browser -- they're free! :twisted: | |
Re: What ways have you tried? It helps is to know *everything* otherwise we'll just tell you to try the same stuff over and over... Did you try testing the value entered in the *keypress* event? | |
Re: 01011001 01101111 01110101 00100000 01110010 01100101 01110011 01110101 01110010 01110010 01100101 01100011 01110100 01100101 01100100 00100000 01100001 01101110 00100000 01110110 01100101 01110010 01111001 00100000 01101111 01101100 01100100 00100000 01110100 01101000 01110010 01100101 01100001 01100100 00101110 00100000 00100000 01000010 01110101 01110100 00100000 01110100 01101000 01100001 01110100 00100111 01110011 00100000 01001111 01001011 … | |
Re: [QUOTE=ardav;]Tagging sounds familiar and comfortable.[/QUOTE] Maybe to you... :icon_wink: ![]() | |
Re: Separate the number into 2 values at the decimal. Convert the numbers into single integers using / and * and % Convert each single digit to character (add 48) Load the character values into your output array | |
Re: Why can't you subtract the [number of tickets entered] from the [number of tickets left] (which starts at 50) and check if the new [number of tickets left] is < 0? | |
Re: [QUOTE=ilovephil;]how can i use F1-F12 in switch case statement??[/QUOTE] Write a program that inputs keystrokes, then displays the values entered in HEX. But standard C cannot input function keys, so you may be out of luck. It all depends on the compiler you are using or how much you want … | |
Re: Your second input for [I]Letter Grade[/I] wants to input into [I]number[/I] (a float) rather than a character. And what values do you expect to get with [iCODE]Sum += LetterGrade;[/iCODE] when [I]Sum[/I] is a float and [I]LetterGrade[/I] is a character? Second: put the switch statement [I]inside[/I] the loop, with all the … | |
Re: [QUOTE=coreyhughes;]I have a question for a homework assignment. This is C, not C++ (sorry! i didn't know where else to go).[/QUOTE] Maybe in the [B]C forum[/B]? I pity the future... :icon_rolleyes: | |
Re: When in the loop: I is incremented by 1 J might be incremented by 2, then it's set to 5 | |
Re: [QUOTE=angelineang;]what is the problem actually in my code?when debug ,it will crash or come out same data. 1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\quiz.c(33): error C2449: found '{' at file scope (missing function header?) 1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\quiz.c(512): error C2059: syntax error : '}' 1> game.c 1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\game.c(29): warning C4244: 'function' : conversion from … | |
Re: Input all the numbers Sort the numbers Remove the duplicates Output what's left | |
Re: [QUOTE=meme meme;]how can i check if the number is positive or not by using switch statement[/QUOTE] Use the % operator in the SWITCH statement. You know what values you will get so use those values in the CASE statements. [QUOTE=meme meme;]please who know the answer help me and answer the … | |
Re: [QUOTE=firstPerson;1780827]You probably forgot to seed it. [/QUOTE] In other words, you didn't use [ICODE]srand()[/ICODE] | |
Re: Find the min/max. The one that's left is the median. | |
Re: What value do you expect [CODE]sizeof(char*)[/CODE] to be? | |
Re: [I]Compare[/I] the beginning of the string with each of the 'commands' and when you get a match test the rest of the string for the parameter(s), converting the digits to numbers if needed. | |
Re: First thing I see is a very complex and IMO cumbersome [iCODE]while[/iCODE] statements. A [iCODE]while[/iCODE] statement is supposed to test something and either enter/continue or exit the loop. It's not meant to input a lot of values and AND the return values of the inputs. Take all those inputs and … | |
Re: By using the proper comparison in the loop statement itself, like [I]while (this is true)[/I] | |
Re: [QUOTE=M09;]In fact, it means upload this book here or any site, to me Amazon i can't buy this books because it's expensive [/quote] That's illegal. That's also stealing. There are enough free resources on the web for you to learn the beginnings of C. Just start doing it. | |
Re: A character doesn't detect EOF. Reading the file detects EOF. Based on what little you posted, that's about all we can say. | |
Re: Not a clue what you are asking. Maybe some details will help in understanding. | |
Re: You need to explain the problem you are having. We can't help you if we don't know what you need help with. | |
Re: This has been answered so many times you should just do a search. | |
Re: #1: [url=http://www.gidnetwork.com/b-56.html]See this[/url] about [iCODE]gets()[/iCODE] #2: See this[/url] about reading a single character with [iCODE]scanf()/fscanf()[/iCODE] [CODE]Read a character. Use a switch to test if it's a TERMINATOR If so, read next character [ if it's a secondary terminator character read one more [ if it's a tertiary terminator [ you've … | |
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: And exactly what is the problem? If we don't know what's going wrong, we can't offer suggestions. Did you try outputting the data that the program read in to make sure the reads worked properly? | |
Re: [iCODE]for (int i=0; i<=0; i++)[/iCODE] -- look carefully... | |
Re: When you go outside the bounds of an array, you simply overwrite variables you shouldn't. You get an exception when you've overwritten enough to leave your dataspace and try to write outside of the program's assigned data space. Expand your loop to 100 or more and you'll probably get your … | |
Re: [QUOTE=Kitson;]I know I haven't tried to read the data in here, but everything I'm doing is wrong and I'm just hitting my head against a wall searching the internet. [/QUOTE] If you haven't tried to read the data, you haven't done anything wrong -- yet! And until you actually [i]attempt[/i] … | |
Re: Where are [iCODE]_delay_ms[/iCODE] and [iCODE]_delay_us[/iCODE] defined? | |
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: Find the end of the 'string' -- the last character Say it's [iCODE]array[x][/iCODE] Set [iCODE]array[x+1][/iCODE] to '\0' The char array is now a string. | |
Re: [QUOTE=jammerjoe;]Love 'em or hate 'em, certifications are a fact of life. [/quote] So is gangrene. [QUOTE=jammerjoe;]Kinda like a pistol...if you have the cert but not the knowledge it's like having a gun but no bullets.[/QUOTE] Or, more to the point, like having a gun [I]with[/I] bullets, and not understanding what … | |
Re: Why? You asked for help before and refused to supply requested information. | |
Re: What did the NotePad's HELP say about the RUN option. | |
Re: Before printing use an IF statement: [iCODE]if (lastCharEntered != 'p') print[/iCODE] |
The End.