5,676 Posted Topics
Re: [code] else { letter=letter-32; for(letter='A'; letter<96 || letter>122; letter++) { [/code] Your [I]for[/I] statement just destroyed the letter you typed in. Also, it would be better to use [I]getchar()[/I] instead of [I]scanf()[/I] to read in a character. [I]getchar()[/I] is designed to read a char whereas [I]scanf()[/I] has to process the … | |
Re: [QUOTE=adily;463105]thanks... the program will show the output that i attach in thread. one more, i don't familiar with this site. so pliss help me to enjoy with this site.... tq..[/QUOTE] To enjoy this site, read the following: [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url] [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]Code Tags[/url] [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]The Rules[/url] | |
Re: [QUOTE=joshSCH;395768]No.. I'd think it would be much more distracting than that. On the radio, you simply listen to music or short news stories with commercial breaks every once in a while. A complete audio story sounds a bit much.. but then again I have never tried it.[/QUOTE] Maybe for you, … | |
Re: Create arrays for each hand and put the deck's first card in the first hand/first card, deck's second card in the second hand/first card, etc. | |
Re: [QUOTE=jbennet;745549]it didnt have a very long lifecycle? IE gets years and years...[/QUOTE] And it shows :icon_twisted: | |
Re: [QUOTE=daviddoria;756760][QUOTE=Xeuron;756741]maybe variant argument list will do ...[/QUOTE] what do you mean xeuron?[/QUOTE] Something you don't have to worry about. Use [B]Dave[/B]'s idea. Also, [url=http://www.gidnetwork.com/b-57.html]read this[/url]. | |
Re: [QUOTE=meistrizy;756630]It also might help if I tell you guys the whole program (*smh*...lol): [/QUOTE] It also might help to tell us what the problem is and what you're trying to accomplish. If this is the same problem as another thread, you should have just continued there. | |
Re: Never Ever call [ICODE]main()[/ICODE] as you are doing in your [ICODE]return[/ICODE] statements. Use a loop. Ony the operating system should be calling [ICODE]main()[/ICODE] Use a lot more whitespace to make your code easier to read. In other words, change [CODE=cpp]if(strcmp(choice, "y")==0) math=diff/i*1000; cout<<""<<x<<" more tries"<<endl;[/CODE] to [CODE=cpp]if (strcmp(choice, "y") == … | |
Re: [url=http://www.gidnetwork.com/b-59.html]This series[/url] might give you some insight on [ICODE]scanf()[/ICODE]. And why would you want to use [ICODE]fgets()[/ICODE] on [ICODE]stdin[/ICODE] to read a character? That's what [ICODE]getchar()[/ICODE] is for. | |
Re: After your [icode]cin >> choice;[/icode] add code to read the rest of the input buffer to clear it out, up the and including the \n. When you enter values, ALL characters you type are in the buffer, including the <ENTER>. When you read a single character, the \n is left … | |
Re: [url=http://www.openwatcom.org/ftp/]Open Watcom C++/Fortran[/url] [url=http://www.borland.com/downloads/download_cbuilder.html]Borland 5.5[/url] (command line, no IDE) | |
Re: [QUOTE=joshSCH;391635]Movies don't really inspire me either.. except Old School, Slackers, Van Wilder, and South Park, of course.[/QUOTE] Oh my ghod! Fear the world the next generation gives us!!!! :icon_twisted: | |
Re: First, you need to learn how to [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. This will help with following the code -- for you [I]and[/I] us. If we can't follow your code, we can't help much. What is the calculation for calculating the interest for one month? How did you arrive at 25.64? If … | |
Re: [QUOTE=Demonisya;736433]Hello..... I want to ask you something..... My teacher gave us our final exam last October 16 & 17.... I want to ask you about this question: Create a program that could show this output * *** **** ****** [/QUOTE] If you'd try reading your post, you'd see that the … | |
Re: [QUOTE=smeezekitty;746108]i have three problems first one is in vc++ 2008 express heres the code...[/quote] And the problem is....? [QUOTE=smeezekitty;746108]Second is in old turbo C++ 1.01 how can i use a similer to if ( X = X) for char instead?[/quote] The exact same way you do it in [I]VC++ 2008[/I]. … | |
Re: 1200 lines of uncommented and badly formatted code. No indication what the warnings are. No indications where the warnings are. How can we possibly help you? Read each line and try to figure out what lines [I]might[/I] be the problem? Try reading [url=http://www.gidforums.com/t-5566.html]the Guidelines[/url]. | |
Re: Yep, pretty bad... and with a [I]grosssssss[/I] ending!!! The best IMO was in [B]Star Trek[/B]'s "Trouble with Tribbles" episode. I still want to know why fight choreographers insist that a swing with fist or sword to the extreme top of the head is an exciting move. Even my grandmother can … | |
Re: [QUOTE=Lerner;744746]don't use the return result of eof() to determine whether the body of the loop will be entered.[/QUOTE] Why is it people just say something without explanation? Why should they listen if there doesn't seem to be a reason? [B]Lerner[/B] [I]is[/I] correct, and [url=http://www.gidnetwork.com/b-58.html]here's why[/url]. [ICODE]feof()[/ICODE] is the same as … | |
Re: [QUOTE=ArkM;744642] Counter-question: what for start label and goto? [code=c++] for (;;) { // loop forever: it's a clear and honest construct ... } // or (I don't like this) while (true) { // longer and precious ... } [/code][/QUOTE] I agree that you should not be using [ICODE]goto[/ICODE]. And I … | |
Re: About [ICODE]scanf ("%c",&opt);[/ICODE] -- [url=http://www.gidnetwork.com/b-60.html]See this information[/url]... [QUOTE=Hempelchen;744266] "}while ((opt!="1") && (opt!="2") && (opt!="3"));" is okay because it forces the input to be 1|2|3. For a menu in c it is okay.[/QUOTE] No it's not. [B]"1"[/B] is a string but [ICODE]opt[/ICODE] is a character. Okay is [ICODE]}while ((opt!='1') && (opt!='2') … | |
Re: Your best bet is to press "M<return>" and use [ICODE]fgets()[/ICODE] to read the input and process the first character. It's portable and will work on ALL compilers. | |
Re: [QUOTE=Krysis;743818]Ahhhhhhhhhh! Thanks for the clarification on the memory issue and FIFO naming! So, if I instead assign two pointers to char to point to argv[4] and argv[3] THEN concat, I should be alright??? OR... not.. :-([/QUOTE] Not. Reread [B]Salem[/B]'s post, specifically [QUOTE=Salem;743785] ... if you want to extend an argv[i], … | |
Re: [QUOTE=monkey_king;742997]I've made a program using gcc as a compiler. In my loops I've been using a uint type as the type of my loop variable. But now it seems that some systems doesn't support this type. Can I make a preprocessor conditional that does a #define uint to unsigned int … | |
Re: No problem's here, either. Fox 2.0.0.3 [B]Midi[/B], you seem to be having problems no one else ever sees. Could your OS be damaged in some way? | |
Re: [QUOTE=NewtoC++;741898]Also, everyone says to avoid goto statements. Can someone tell me alternates to using goto? Like could you give me an example of where I used goto and show me another way.[/QUOTE] Sure. In general: [code] do { [I]display menu input [B]MenuValue[/B] process the menu entry selected[/I] } while ([b]MenuValue[/b] … | |
Re: Start your "unique number" at 1 and increment it for each new data record. That seems to be the easiest and safest way to make all your numbers [I]unique[/I]. | |
Re: By reading each character one at a time. If you get to 5 and that character is not '\n', print an error and clear out the rest of the characters from the input buffer. | |
Re: Here, let me help you with the [ICODE]gets()/fgets()[/ICODE] question: [url=http://www.gidnetwork.com/b-56.html]Click Here[/url]. And I'm sure it's inevitable, he's going to do the same with [ICODE]scanf()[/ICODE], too, so: [url=http://www.gidnetwork.com/b-62.html]Click Here[/url] too. | |
Re: What he's getting at is variables should be [I]defined[/I] only in code files, the .C or .CPP files. NEVER put a definition in a header file. Only the [ICODE]extern[/ICODE] goes in the .H file. The guards are only useful when a header file is used twice during a single compilation. … | |
Re: I wouldn't do it. Flashing a message in different colors is one of the most obnoxious things you can do to a user IMO. | |
Re: I've looked at your post for about 5 minutes and have absolutely no idea what your question is about! OK, you're having a problem with a line. The line is only for reference -- whatever that means. Where do you [I]explain[/I] what the problem is? Or what happens to show … | |
Re: Probably questions about programming in C. I assume lots of the stuff you learned in the course. | |
Re: [QUOTE=MidiMagic;630891]Why I need more than 30 minutes: If you navigate to get a link or an object, when you return, the post text is GONE from the editing box. You must post it, and then edit it after you get the item into the clipboard. With the torpidity of the … | |
Re: Did you miss the sticky post entitled [B]We only give homework help to those who show effort[/B]? Or maybe the one titled [B]Read This Before Posting[/B]? What about [B]The Rules[/B]? | |
Re: Please [url=http://www.gidnetwork.com/b-38.html]read this[/url], so we can follow your code. It will also show you some problems you can fix yourself. | |
Re: [QUOTE=xlx16;737704]i have two questions,please dont tell me that i violate dani web ruls because of my long questions thank u. [/quote] As [B]jbennet[/B] said, long Q's are fine, but your title is a violation. [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]See the rules[/url]. Sorry, you asked for it. :icon_twisted: [QUOTE=xlx16;737704]and the other question. [code=c] #include<stdio.h> void … | |
Re: Compilers [url=http://www.codeblocks.org/downloads.shtml]Code::Blocks[/url] [url=http://msdn.microsoft.com/vstudio/express/visualc/]MSVC++ Express[/url] [url=http://www.openwatcom.org/ftp/]Open Watcom C++/Fortran[/url] [url=http://www.bloodshed.net]Bloodshed DevC[/url] [url=http://cc.codegear.com/Free/turbocpp]Turbo C++ Explorer 2006[/url] [url=http://www.borland.com/downloads/download_cbuilder.html]Borland 5.5[/url] | |
Re: [QUOTE=coolbuddy059;733322]I've to do a documentation of a project please tell some links of some sites where I can get the free source code of telephone directory management etc.[/QUOTE] I didn't know there [I]was[/I] free source code to telephone directory management etc. Where did you hear of this free code? Maybe … | |
Re: [QUOTE=Kira71;737052]anything wrong here?[/QUOTE] Yes. In addition to what the Dragon mentioned, 1) you need to fix your [url=http://www.gidnetwork.com/b-38.html]formatting[/url] so we can follow your code; 2) you are using [url=http://www.gidnetwork.com/b-58.html]feof()[/url] incorrectly. This will cause you problems when the function seems to be working; 3) never, ever use [url=http://www.gidnetwork.com/b-56.html]gets()[/url]. Gives you a … | |
Re: Be sure to use braces {} more often. It makes the code more readable, and you'll know you are grouping statements properly. | |
Re: [QUOTE=~s.o.s~;736658]Congratulations on using: - Code tags for your first post. - [ICODE]int main(void)[/ICODE] instead of the usual [ICODE]void main()[/ICODE] for your first post. You have a bright future ahead! :-) [/QUOTE] Agreed! But loose a point for bad [url=http://www.gidnetwork.com/b-38.html]formatting[/url], making your code very hard to follow. | |
Re: To rephrase [B]Sillyboy[/B]'s explanation -- the functions [I]do not return a value[/I]. Therefore there is no value to test [B]==[/B] nor [B]!=[/B] against. | |
Re: You have a comment [I]/* loop through linked list to find last node */[/I] but there is no loop. Only a single IF statement. | |
![]() | Re: I can't read it. Someone missed all 6 references to CODE tags that are all over the site. |
Re: [QUOTE=Syrus_Jones;735722]Ok, i just realized what an idiot i am, i got the factor thing figured out, and putting in increasing order, but........can someone help me with the 4 factors per line...[/QUOTE] Count each value you output. When you get to 4, output an [ICODE]endl[/ICODE] and reset your counter. [QUOTE=Syrus_Jones;735722]... and … | |
Re: [QUOTE=Chaudharybilal;736496] i need to make a program on Human simulation....... Well what i need is a code. [/quote] We don't give code. We give help. [I]You[/I] give code. [QUOTE=Chaudharybilal;736496]when i am executing a program like am printing 'x' for infinite many times during execution when the console is printing x … | |
![]() | Re: How many people have to post the exact same message? Isn't one enough? :icon_rolleyes: |
Re: Where is your [icode]main()[/icode] function? And please read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url], especially [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]this section[/url] about thread titles. |
The End.