5,676 Posted Topics

Member Avatar for xEffrego
Member Avatar for angrymasteryoda

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?

Member Avatar for WaltP
0
144
Member Avatar for Tygawr

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.

Member Avatar for WaltP
0
284
Member Avatar for gethelpcpp123

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.

Member Avatar for WaltP
0
112
Member Avatar for Dani

> 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 …

Member Avatar for Dani
0
526
Member Avatar for slashqb

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 …

Member Avatar for slashqb
0
174
Member Avatar for Ahmed Sarwat

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*"

Member Avatar for WaltP
0
207
Member Avatar for pattilupwned

>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 …

Member Avatar for pattilupwned
0
2K
Member Avatar for WaltP

Over the past couple days I've marked ModPlace and Feedback Forums as READ several times and still get 'NEW' posts. ![dani2](/attachments/small/0/dani2.JPG)

Member Avatar for Dani
0
184
Member Avatar for jodzjcm

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.

Member Avatar for WaltP
0
149
Member Avatar for Dani
Member Avatar for LFCDay123

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?

Member Avatar for ChrisPadgham
0
130
Member Avatar for linux

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 …

Member Avatar for vinnitro
2
1K
Member Avatar for Dani

[QUOTE=ardav;]Tagging sounds familiar and comfortable.[/QUOTE] Maybe to you... :icon_wink:

Member Avatar for diafol
0
279
Member Avatar for gemni7

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

Member Avatar for sujeeth.ramesh
0
677
Member Avatar for KRUX17

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?

Member Avatar for KRUX17
0
139
Member Avatar for ilovephil

[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 …

Member Avatar for jbennet
0
177
Member Avatar for joseph_butler

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 …

Member Avatar for absar.mazhar
0
4K
Member Avatar for coreyhughes

[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:

Member Avatar for coreyhughes
0
130
Member Avatar for hey.howdy
Member Avatar for hey.howdy
0
154
Member Avatar for angelineang

[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 …

Member Avatar for WaltP
0
148
Member Avatar for a_sd

Input all the numbers Sort the numbers Remove the duplicates Output what's left

Member Avatar for WaltP
0
139
Member Avatar for meme meme

[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 …

Member Avatar for Tygawr
0
141
Member Avatar for FALL3N

[QUOTE=firstPerson;1780827]You probably forgot to seed it. [/QUOTE] In other words, you didn't use [ICODE]srand()[/ICODE]

Member Avatar for FALL3N
0
280
Member Avatar for butler273
Member Avatar for TreeBranches
Member Avatar for IcyFire

[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.

Member Avatar for IcyFire
0
182
Member Avatar for pattilupwned

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 …

Member Avatar for m4ster_r0shi
0
223
Member Avatar for FraidaL

By using the proper comparison in the loop statement itself, like [I]while (this is true)[/I]

Member Avatar for Tygawr
0
395
Member Avatar for M09

[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.

Member Avatar for M09
0
267
Member Avatar for zingwing

A character doesn't detect EOF. Reading the file detects EOF. Based on what little you posted, that's about all we can say.

Member Avatar for Ancient Dragon
0
146
Member Avatar for fredz0003

Not a clue what you are asking. Maybe some details will help in understanding.

Member Avatar for WaltP
0
114
Member Avatar for mohy93

You need to explain the problem you are having. We can't help you if we don't know what you need help with.

Member Avatar for WaltP
0
215
Member Avatar for pattmorter
Member Avatar for WaltP
0
179
Member Avatar for zingwing

#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 …

Member Avatar for zingwing
0
283
Member Avatar for Raymond Pua

[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] …

Member Avatar for WaltP
0
195
Member Avatar for Jorox03

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?

Member Avatar for WaltP
0
214
Member Avatar for FraidaL
Member Avatar for james6754

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 …

Member Avatar for jbennet
0
116
Member Avatar for xavier93
Member Avatar for Kitson

[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] …

Member Avatar for WaltP
0
847
Member Avatar for siqu
Member Avatar for siqu
0
461
Member Avatar for sneaky666
Member Avatar for tamana

[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] …

Member Avatar for Lerner
0
418
Member Avatar for ShEeRMiLiTaNt

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.

Member Avatar for Lerner
0
912
Member Avatar for CertifiedMan

[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 …

Member Avatar for jbennet
0
191
Member Avatar for slygoth
Member Avatar for python_adz

Why? You asked for help before and refused to supply requested information.

Member Avatar for python_adz
0
161
Member Avatar for revenge2
Member Avatar for TheWind147

Before printing use an IF statement: [iCODE]if (lastCharEntered != 'p') print[/iCODE]

Member Avatar for WaltP
0
3K

The End.