5,676 Posted Topics
Re: Yes we can help you, but you must post code for us to help with. Read the Rules and the important sticky posts for info. | |
Re: But it [I]does[/I] say that people that have clout like what you say... :icon_wink: | |
Re: Since you are using [ICODE]upperCase [/ICODE]and [ICODE]lowerCase [/ICODE]as character arrays rather than strings, you need to output each value individually. If you want to use them as a string, you need to remember that as [I]string[/I] always ends with \0, so they need to [B]27[/B] characters long. ![]() | |
Re: Wouldn't it be helpful to us that aren't psychic to actually explain the problem? I assume you are having trouble compiling. | |
Re: [iCODE]0x8000000000000000[/iCODE] is the 'sign bit' of a 64 bit value. [ICODE]AND[/ICODE] it with the value you want to check. If [I]TRUE[/I], the sign bit is set. | |
Re: [QUOTE=orium;442936][QUOTE=Dave Sinkula;442928]Assuming a solid rectangle, you have nested loops: outer loop counts rows, inner loop counts columns; inner loop contains output of char1, at the end of the inner loop you output a newline. A typical loop would be such like this. [code]for ( int r = 0; r < … | |
Re: Why didn't you use CODE TAGs? Information is posted all over this site about CODE tags, like 1) in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] you were asked to read when you registered 2) in the text at the top of this forum 3) in the announcement at the top of this forum titled … | |
Re: :icon_rolleyes: What a bunch of useless responses :icon_rolleyes: except for [B]Tom[/B]'s... Why you don't use [ICODE]void[/ICODE] with [ICODE]main()[/ICODE]: [url=http://www.gidnetwork.com/b-66.html]click here[/url] | |
Re: Put the digits into a char string. When you get a non-number. convert the digits using a function such as [iCODE]atoi()[/iCODE]. Copy the operator to another variable. | |
Re: Craps, poker, PI to 500 digits, proof of perpetual motion, planetary positions at any given date/time, accounting system for a garage. | |
Re: I usually have to do some work to get something I need. You have to, also. | |
Re: I don't see any need to separate the lines into words, just look at the characters after you read the line and if you see a space just ignore it. Easiest way I can think of is to set up a 256 integer array and for each character increment the … | |
Re: [QUOTE=Madzts;362844]Hi. . can any one help me in converting infix to postfix. . i do not know what is wrong in my code. . help!!!plz [/QUOTE] Neither do we, you didn't tell us what it's doing wrong, nor what it does right. We need information to understand the problem. And … | |
Re: Let's see... No CODE tags, even thought there are at least 6 places they are explained, and 3 of them on the main page alone. No explanation about why code was posted I guess all there is to say is: Congrats for writing some code! What's next? | |
Re: Start by doing 1a which is very basic and quite simple. Then start adding the code for 1b. When you get stuck actually coding, we can help you overcome those problems. But you have to code something for us to help with. | |
Re: All you do is set [iCODE]valid[/iCODE] to false at the beginning, never change it anywhere else in the code. Think again -- what is the exit condition you need for the [ICODE]while[/ICODE] and [ICODE]do-while[/ICODE] loops. | |
Re: It also never gets a new number. The line [ICODE]guessNumber = rand() % 100 + 1;[/ICODE] Needs to be inside the loop. | |
Re: [QUOTE=asmahaque_456;1017220]How will i convert this binary code"10110111" into decimal value? I have used the following codes[/QUOTE] Did your code work? If not, what happened? What value did you input? What value was output? How can you tell it didn't work? | |
Re: [quote=FireSBurnsmuP;260924]So, how do I get the length of a string in C++?[/quote] stringvariable.length() | |
Re: You need to use a loop and divide the number [B]n[/B] by each odd number from 3 to [B]n/2[/B]. If any number divides [B]n[/B] evenly (no remainder) [B]n[/B] is not prime. | |
Re: You already have a thread started. You don't need to start many threads on the same topic. And you neglected to read any of the requested information posted all over this site about CODE tags, like 1) in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] you were asked to read when you registered 2) in … | |
Re: [QUOTE=needhelpe;1016017]hello! I just made a palindrome. that inputs an integer between 1 and 9, and should output:[/QUOTE] We're glad you wrote the program and it works. Very proud of you. | |
| |
Re: Yes it is a good place. But if, as you say, "[I]when someone has NO IDEA where to begin or what to do[/I]" this is not the place to get started. Their instructor is the one to ask. Once they have some code that looks like they at least [I]tried[/I] … | |
Re: If you want to know how a program works, plzzzzzzzzzzzz post a program. Or try reading the Rules for the site. | |
Re: Get the return value from the [INLINECODE]msgbox[/INLINECODE] call. It returns the button value pressed. | |
Re: First of all, [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so it can be followed. This code:[ICODE] m = ~(arrX[I]);//convert to unsigned m == m+1;[/ICODE] does not convert to unsigned. [ICODE]m == m+1;[/ICODE] is a comparison. Since you know [ICODE]arrX[i][/ICODE] is negative, just do [ICODE]arrX[i] = -arrX[i];[/ICODE] | |
Re: Another confusing request... [QUOTE=PennKen2009;308020]I'm new at C++ and I'm trying to right a program that will generate random numbers from a range of 1-19. Here's how it should work, the program will generate 5 random numbers all ranged 1-19 and in random order. Once it chooses the first number, that … | |
Re: So you want us to figure out what your program is supposed to do, figure out what is going wrong, and fix it for you? Mind giving us a hint? | |
Re: Since doubles are rarely exact, probably your loop counter is wrong. For example when you think [I]i=4[/I] it's probably [I]i=3.9999902[/I] or something like that. | |
Re: First, [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. Second, explain what you need help with. Don't make us guess. | |
Re: [QUOTE=hunvilr;1010730]can somebody figure out whats happening. [/QUOTE] #1) No code tags #2) [iCODE]void main()[/iCODE] is wrong -- [url=http://www.gidnetwork.com/b-66.html]see this[/url] #3) No formatting makes the code difficult to follow -- [url=http://www.gidnetwork.com/b-38.html]see this[/url] #4) [ICODE]feof()[/ICODE] misuse -- [url=http://www.gidnetwork.com/b-58.html]see this[/url] #5) Reading and writing to the same file makes the program difficult to … | |
Re: The [iCODE]rename()[/iCODE] function renames, does not copy. You need to open 2 files: the original file for reading, the new file for writing. Then read the old file and write to the new file. | |
Re: [QUOTE=cscgal;1003422]Are you aware the little rep counters are actually little buttons to easily up-vote or down-vote a post without affecting someone's reputation points? ... But meanwhile if you do give reputation it also up-votes or down-votes for you automatically.[/QUOTE] Oh, so [I]that's[/I] what's going on... Got it! | |
Re: [CODE] for(i=loc;i>=first;i--) { if(sorted_array[i] != key) first=loc-1; } [/code] A [iCODE]while[/iCODE] loop would be better here... [code] if(key=sorted_array[first]) { count2++; first++; } [/CODE] ... and here. | |
Re: Yes, be consistent with your input. Always use [iCODE]getline()[/iCODE] and you shouldn't have to worry about [iCODE]cin.ignore()[/iCODE] | |
Re: [QUOTE=cscgal;1002044]... DaniWeb is skewed towards a more tech saavy audience.[/QUOTE] Why would [I]tech savvy[/I] be equated with higher than 1024x768? Don't [I]tech savvy[/I] users use laptops? Aren't there a few [I]tech savvy[/I] users older and need glasses? I'm with AD on this one. I personally use windowing, which to me … | |
Re: [QUOTE=cscgal;1002807]OK ... [B]Thread preview now works for code snippets, so you can see exactly what the formatting will look like before you post.[/B] Everyone who submits a code snippet should always preview it first![/QUOTE] Maybe only the PREVIEW button should be available during initial composition. Then SUBMIT can be available … | |
![]() | Re: [quote=may4life;273956]... otherwise declare void main()[/quote] [INLINECODE]main()[/INLINECODE] is an [I]int[/I] function and officially cannot be be declared as [I]void[/I]. In fact, some compilers flag a warning if [I]void[/I] is used. Forget what M$ claims in their help. They [I]are[/I] wrong. :confused: |
Re: Interesting. This caught my eye: [QUOTE]Governments and legislators chip in that the combined lack of enthusiasm from both sides of the TV industry suggesting it is pointless in legislating to force them into making the technology available when people clearly do not want it.[/QUOTE]Isn't that what they said about talking … | |
Re: [B]Dave[/B]'s link no longer works, but [URL="http://images.google.com/images?q=vending%20machines&ie=UTF-8&oe=UTF-8&client=firefox-a&rls=org.mozilla:en-US:official&sa=N&tab=wi"]this one[/URL] does... | |
Re: [QUOTE=markdean;297566]I always think that a programmer should know what's under the hood. I think that starting with Assembly and then moving up is something that new programmers should always do. It means that you have a good grasp as to what is going on and can optimize your code by … | |
Re: [QUOTE=Dream2code;920635]i got the chart thanks for that.But do i need to read each bytes then decode it according to the chart? [/QUOTE] Yes. | |
Re: [QUOTE=daviddoria;941513]@Salem Why would you use spaces instead of tabs? I never understood that, I always set it to tabs - then one keystroke/character replaces several, no?[/QUOTE] Yes, but if set to spaces, pressing the TAB key can add 4 spaces which makes code much easier to read. And when posted … | |
| |
Re: [QUOTE=itzAB;936220]I am too new to c programming.I think as the program doesnt return any value you should either put void main,[/quote] NEVER use [url=http://www.gidnetwork.com/b-66.html]void main()[/url] | |
Re: [B]weird[/B] is not an approved IT term. Be specific. Give details. What is the first question your mechanic would ask if you told him "my car is acting weird?" | |
![]() | Re: [QUOTE=Lioshenka;929707]Hello all, in time of need I always come here to cry for help) Anyways. What I need to do is to store data about people in a binary tree. They need to come from a file, but for now I can hardcode them in.[/quote] Well, I suppose the first … ![]() |
Re: Learn to [url=http://www.gidnetwork.com/b-38.html]Format your code[/url]. That generally solves every bracket problem immediately. |
The End.