5,676 Posted Topics
Re: 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 | |
Re: Resurrecting and hijacking an old post is not a good way to introduce yourself. | |
Re: That works fine with [B]Fbody[/B]'s changes. | |
Re: [QUOTE=shah1248;1146183]Try [icode] if (key == 27) [/icode][/QUOTE] Has that worked for you? How? | |
Re: By learning Visual Basic well enough to write a system. | |
Re: [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 … | |
Re: Put the code in a loop. As for the 12, you need to look up the [iCODE]srand()[/iCODE] function. | |
Re: What is [iCODE]__cdecl[/iCODE]? (asking OP, not everyone) | |
Re: 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. | |
Re: 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]? … | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: [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. | |
Re: 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. | |
Re: 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. | |
Re: [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 … | |
Re: 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? | |
Re: You need to pass the size as well as the array. That's the only way the function knows how big the array is. | |
Re: 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. | |
Re: [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 … | |
Re: [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 … | |
Re: 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. | |
Re: [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] | |
Re: Have you come up with any ideas at all? | |
Re: 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. | |
Re: [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 … | |
Re: Sure. Try [url=http://lmgtfy.com/?q=qt%20tutorial]this[/url] | |
Re: [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 … | |
Re: [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 . | |
Re: What is the value of [B]x[/B] when you enter your [iCODE]while[/iCODE] loop? | |
Re: [B]0.000796327[/B] is effectively 0. Look up the [B]iomanip[/B] header and output exactly the number of decimals you need. | |
Re: 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 =. | |
Re: 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? | |
Re: [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 … | |
Re: 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 … | |
Re: [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 … | |
Re: [url=http://lmgtfy.com/?q=root+bisection+method]See This[/url] | |
Re: 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. | |
Re: Where are the code tags? Where is [I]main()[/I] defined (unresolved external symbol _main) Did you link with the debug library? | |
Re: 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 … | |
Re: Stop begging! Jeez! You sound like a whiny child in love with the letter Z. | |
Re: 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. | |
Re: If you have no clue how to accomplish this, you'd better start reading your book fast. Start with your [iCODE]include[/iCODE]s |
The End.