5,676 Posted Topics

Member Avatar for Denver Cupido
Member Avatar for riahc3

Three loops. Loop one -- prints a full line Inside that loop is two loops: Loop 1 prints the spaces before the '*'s Loop 2 prints the '*'s

Member Avatar for shah1248
0
109
Member Avatar for William Hemsworth

Resurrecting and hijacking an old post is not a good way to introduce yourself.

Member Avatar for William Hemsworth
0
765
Member Avatar for timbomo
Member Avatar for iNach

[QUOTE=shah1248;1146183]Try [icode] if (key == 27) [/icode][/QUOTE] Has that worked for you? How?

Member Avatar for xavier666
0
8K
Member Avatar for corales
Member Avatar for student02
0
87
Member Avatar for Learning78

[QUOTE=Learning78;1145964]@ firstPerson thanks for your suggestion.. I did like this.. but in this way, every space is also counted as character and plays role in comparison whereas I would like to compare only words. e.g. if 3 words out of 5 are correct, it should reply correct. ---- Any more …

Member Avatar for WaltP
0
272
Member Avatar for khaled.s

Put the code in a loop. As for the 12, you need to look up the [iCODE]srand()[/iCODE] function.

Member Avatar for WaltP
0
215
Member Avatar for prakashjoshi010
Member Avatar for tarheelfan_08

Then IMO you need to start over. Write a little bit, get it working. Then write a little more, get it working. Write a little more.... Trying to debug 260 lines with no idea where the errors could be is very difficult.

Member Avatar for tarheelfan_08
0
114
Member Avatar for tquiva

Based on what I see: [CODE] /* Obtain two inputs from user */ printf("Enter a real number: "); input = scanf("%f", &x); while (input != EOF) { /* Invoke function to obtain max of both numbers */ maximum = max(x, y); [/CODE] You accept [B]x[/B]. Where do you read [B]y[/B]? …

Member Avatar for tquiva
0
229
Member Avatar for sunlitdays

I don't see a problem. Maybe you need to post some details about the "sometimes". By the way, I would get rid of the [iCODE]while[/iCODE] and change the [iCODE]if[/iCODE] statements into [iCODE]while[/iCODE] statements. Do all the seconds at once then move on to the minutes. [edit] Oh. You always subtract …

Member Avatar for WaltP
0
167
Member Avatar for react05

First things first -- [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so we can follow what you are doing. The concepts looks good except for the ';' on line 6. I'd also change the names of [B]stack[/B] and [B]stack2[/B] to [B]value1[/B] and [B]value2[/B]

Member Avatar for WaltP
0
106
Member Avatar for KRal

Please give a better description of the problem than "[I]random numbers that are supposed to be generated will not cout[/I]" That makes little sense.

Member Avatar for WaltP
0
153
Member Avatar for khaled.s

You haven't given us any direction what you need help with. We will not write the code for you, but with the lack of details you've given, that's all we can do. Start by writing the code to input your value. If you can do that, we might be able …

Member Avatar for JasonHippy
0
164
Member Avatar for crozbme

Can you try to give some details? Like where the problem is, what values are involved, what garbage characters. Without details we have no idea where to start since we didn't write the program.

Member Avatar for WaltP
0
103
Member Avatar for D4n1sD
Member Avatar for Xufyan

[QUOTE=anup375;1146236][CODE=c] for (i=0;i<3;i++) { for (j=2;j<8;j=j+2) { printf("value of a is %d, value of b is %d",i,j); } } [/CODE][/QUOTE] Gee, I thought the OP said [QUOTE=Xufyan;1146219]i want to write a program using "for" loop[/quote] You just screwed him over.

Member Avatar for WaltP
0
286
Member Avatar for Xufyan

The statement [ICODE]a = a++;[/ICODE] gives what is called [I]undefined behavior[/I] because it is changing the variable [B]a[/B] twice. Therefore the result may not be as expected. Use either [ICODE]a = a+1;[/ICODE] or [ICODE]a++;[/ICODE] but not both.

Member Avatar for shah1248
0
296
Member Avatar for Ballistix

First thing is you have to try to make it a function. Then describe the problem you are having with it. We can then offer suggestions.

Member Avatar for Fbody
0
205
Member Avatar for yznk

[QUOTE=HealBrains;1145545]Edit: Hey mods, can we write structured pseudo code? Or is that too much of a handout?[/QUOTE] Sure. Write it kind of general so the posters still have to think some. I do pseudo code a lot. [QUOTE=HealBrains;1145614]Edit: I'm a noob.[/QUOTE] Why does everyone say this? Don't you think we …

Member Avatar for HealBrains
0
183
Member Avatar for tquiva

You need to give better details than "strange numbers". What's your input? What's your output? What were you expecting? What part of the program do we need to look at?

Member Avatar for anup375
0
109
Member Avatar for tikoti

You need to pass the size as well as the array. That's the only way the function knows how big the array is.

Member Avatar for mrnutty
0
160
Member Avatar for jiten_raulo

The book should show you examples, doesn't it? Make a file called [B]counter.h[/B]. Put the entire class definition in it. Erase the definition from the C++ code file. That's all there is to it.

Member Avatar for jiten_raulo
0
140
Member Avatar for Christoph928

[QUOTE=Christoph928;1145537]here is my improved code still need help though.[/quote] You do? I don't see any description about what you need help with. Are we just supposed to guess? [QUOTE=Christoph928;1145537].any advice is appreciated:[/QUOTE] Always explain what you need, and why. Never leave it to us to guess. Mostly we guess wrong …

Member Avatar for WaltP
0
198
Member Avatar for gnarlyskim

[CODE]char input; char output; cout<<"Enter input file name : "; cin >> input; cout<<"Enter output file name : "; cin >> output; while(!in.eof()) // in is not even open, it can't be at EOF yet { in.open(input); // Open in while(false) { if(in.fail()) // If in is in failure state …

Member Avatar for gnarlyskim
1
185
Member Avatar for Unidennn

Keep track of the number of days per year. If you need March 12, that would be 31+28+12 (Jan+Feb+Mar). Now you can use your 7 days to get the days of the week. The % (mod) operator can help here.

Member Avatar for Unidennn
0
80
Member Avatar for lethal.b

[code] Copy the first letter to the new array Start a loop (to copy letters) Start a Loop (to compare letters) Compare the current letter with all letters in the new array If not there, Copy it. [/code]

Member Avatar for WargRider
0
111
Member Avatar for XinJiki
Member Avatar for Cristofor

What would you like to change it to? What would be the purpose of it? You only specify a header because you need to functions it references. You don't add headers because you like adding headers.

Member Avatar for Dave Sinkula
0
190
Member Avatar for Eternity[LK]
Member Avatar for stevebtn

[QUOTE=stevebtn;1144857]Hello, I am very new to C but need to use it to resolve a problem. I have a variable called "W12". All I want to do is increment W12 to W13, W14 etc and then use it later in my code (I am using QA Load to load test …

Member Avatar for WaltP
0
101
Member Avatar for Asalearam
Member Avatar for Stefano Mtangoo
0
541
Member Avatar for Grap

[QUOTE=Grap;1144449]There are about 15 non-empty lines in my text file before the blank lines and I am able to read everything in them properly. Once I reach the blank lines , both tmp1 and tmp2 are printed blank Can anyone figure out what the problem is?[/QUOTE] The problem is you …

Member Avatar for VilePlecenta
0
9K
Member Avatar for faaz

[QUOTE=VernonDozier;1144564]I imagine that the "forum police" would agree with me.[/QUOTE] We do. This thread almost got closed. Clean up your attitude, [B]faaz[/B]. You get more help by being thankful than being belligerent .

Member Avatar for faaz
0
175
Member Avatar for maria1110

What is the value of [B]x[/B] when you enter your [iCODE]while[/iCODE] loop?

Member Avatar for WaltP
0
132
Member Avatar for lloydi12345

[B]0.000796327[/B] is effectively 0. Look up the [B]iomanip[/B] header and output exactly the number of decimals you need.

Member Avatar for WaltP
0
131
Member Avatar for Volestar

A one-character array is not a c-string. [iCODE]strcpy()[/iCODE] only works on null-terminated strings. As [B]sheff[/B] said, there is no need to define a 1-element array. Just define the value as a [ICODE]char[/ICODE] and copy it to another [ICODE]char[/ICODE] with =.

Member Avatar for WaltP
0
324
Member Avatar for iammfa

Try it with 9. You will find it is also even because in the loop when j=3, [B]n%j = 0[/B] This loop has nothing to do with odd/even. Where did you get this code?

Member Avatar for WaltP
0
101
Member Avatar for vidit_X
Member Avatar for yopirates

[QUOTE=yopirates;1137186]hi.. friends.. i hav created a new form!! 4 my project but i need a horizontal scroll bar to be attached to it so that i can add more no sections.. to right side of the form!! 15360*11520 is the default size of the form!! i want to increase the …

Member Avatar for yopirates
-1
154
Member Avatar for lionaneesh

I'm really sorry you've wasted an entire 15 minutes waiting for your personal help. Next time let us know when you're going to log in and we'll make sure everyone is here just for you. Closed -- sheesh! There's just nobody here that has any suggestions for you at the …

Member Avatar for jonsca
0
169
Member Avatar for Anarionist

[QUOTE=Anarionist;1143197]I wish there was an option in the "What are you posting" for tutorials hehe. But I guess I will just have to right it here :). If anyone else has any pointers (pun intended) let me know ;). Ok if your like me and were wondering how to accept …

Member Avatar for Nick Evan
-1
102
Member Avatar for callister
Member Avatar for zhane3

You already have your input in individual characters. That's how a character array works. With characters there is no such thing as [I]1 entry[/I]. It's always a character array.

Member Avatar for WaltP
0
129
Member Avatar for linq

Where are the code tags? Where is [I]main()[/I] defined (unresolved external symbol _main) Did you link with the debug library?

Member Avatar for NathanOliver
2
196
Member Avatar for EPhantom

It seems to me you college would have all the answers you are asking. They will know what the major would be called. They will know their industry ranking. They will even be able to tell you what classes you would need to complete the major. Maybe you should talk …

Member Avatar for jwenting
0
158
Member Avatar for naveenjoshi

Stop begging! Jeez! You sound like a whiny child in love with the letter Z.

Member Avatar for Salem
-2
80
Member Avatar for HBK_100
Re: File

Don't bother. 6 posts with no code tags = 1 warning and 5 infractions. Fastest ban I've ever seen that wasn't for spam.

Member Avatar for WaltP
0
118
Member Avatar for prietysharma121

If you have no clue how to accomplish this, you'd better start reading your book fast. Start with your [iCODE]include[/iCODE]s

Member Avatar for WaltP
-2
143

The End.