5,676 Posted Topics
Re: Unfortunately, your code is very hard to follow. Indentation is necessary for readability, but you went to the extreme and lost readability. [url=http://www.gidnetwork.com/b-38.html]See this[/url] for formatting help. Also, you are using a very dangerous command -- [url=http://www.gidnetwork.com/b-56.html]gets()[/url] -- click to see why. And a few questionable commands: [url=http://www.gidnetwork.com/b-61.html]system("pause");[/url] [url=http://www.gidnetwork.com/b-60.html]scanf("%c", ...);[/url] … | |
Re: [QUOTE=Duoas;530865]> As my case in point, your function is woefully broken in that it completely fails to do what it's supposed to do, which is reverse [B]all[/B] of the bits. (emphasis added) Well, that depends entirely on what you mean by "all".[/quote] Not really. There is only one [I]acceptable[/I] definition … | |
Re: [QUOTE=VernonDozier;531806]You need to be more careful and detailed when writing your posts, and you need to preview your posts before you submit them. I put "code=C++" in quotes because when I put them in brackets, the web page didn't recognize that I wanted to display the actual words. I see … | |
Re: [QUOTE=ankit_the_hawk;530650]I am starting to develop a calculator in C++ which accepts the expression in the form: 2+3 or 2/3 ,etc. ( for the time being, only two operands and one operator) Once i get that done, I will begin the process of continuely expanding it :)[/QUOTE] Good idea. [QUOTE=ankit_the_hawk;530650]The problem … | |
Re: [QUOTE=newport;531566]I'm trying to make a program that asks the user what he/she wants to do, but when invalid inputs are entered, the program does not tell the user right away. [/quote] Meaning what? Like you enter 6 for selection and have to enter your two numbers before you are told … | |
Re: You must have missed reading [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] as requested when you registered, as well as the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url] at the top of the forum... | |
Re: [QUOTE=joshSCH;531682]Perhaps there is a reason that people are giving you bad rep? Have you ever thought of that? I mean, if people were giving you bad rep on the other site.. and people are now giving you bad rep here... it's only logical to assume that you are doing something … | |
Re: And array cannot contain 2 empty dimensions in a function. You must fill in at least the left dimension. | |
Re: [QUOTE=arunpawar;531999]i'm looking for tutorial to get started in VC++,i dont want book cause i most of the books are therautical and without code or actual implementation.[/QUOTE] Where do you get this idea? Go to a bookstore and start looking at books. Most have code. | |
Re: Use the mod (%) opreator followed by the divide (/) operator to check each digit. | |
Re: I for one can't follow your code because of the awful indentation. [url=http://www.gidnetwork.com/b-38.html]Here's some information[/url] on how to format your code so it's understandable. | |
Re: [QUOTE=afg_91320;531763]hi guys. its me again. after going thru my prblm i was able to get thru a few of the kinks. however, i still am having issues with the mathematical statements. [/quote] And you still haven't bothered to read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Forum Rules[/url] yet because 1) you have a terrible title … | |
Re: [QUOTE=vegaseat;64775]I checked my old Borland C++ compiler, you may have to add the .h to your includes! #include<iostream.h> #include<cstdlib.h>[/QUOTE] [QUOTE=romerboy55;531005]as for the second error its because your calling rand() which is in the file math.h try including that the compile again[/QUOTE] Ahhh, all these clueless people. Obviously [I]iostream[/I] worked. But … | |
Re: It depends on what the 'fail' is. I assume it's because (this is a fact not an assumption) the parameters for the [icode]pow()[/icode] function are not integers. But I might be wrong that that's what your 'failure' is. | |
Re: And your problem is...? When asking for help, you really need to explain why you need help. And "[I]because it's wrong[/I]" or "[I]because it's due[/I]" are not acceptable. | |
Re: Next time you could EDIT your wrong post... | |
Re: [QUOTE=chandra.rajat;529297]method of learning i use is to take up a book and start with the basics.. try simple programs for the each topics and then move ahead.. [/QUOTE] Nice idea -- if you are learning on your own. When you are taking a class you [I]must[/I] follow the instructor. | |
Re: When explaining a problem, explain the problem. Simply saying "[I]It outputs it completely wrong...[/I]" tells us nothing. Explain exactly [I]why[/I] it's wrong and also add what the answer should be. Don't let us guess. [icode]batAvg = singles + doubles + triples + homeRuns / atBats;[/icode] is wrong. Use parentheses because … | |
Re: Gack!!!! Hex 38 55 FD FF already [I][B]is[/B][/I] -174792! Just reverse the bytes because of it's [I]endian[/I]-ness. You don't need XORs, bits, anything like that. [QUOTE=tootypegs;528825]I used the string 7A 72 FC FF. I tranformed them to little endian (FF FC 72 7A). then preformed a bitwise xOR on them … | |
Re: [QUOTE=kux;528383]lol, it replaced : fs with the smiley , u know what i mean actually :P :))[/QUOTE] That's why we insist on people leaning to use CODE tags, as mentioned in the rules you read when you signed up. | |
Re: Your loop in lines 13-18 are missing a step. Did you read the Rules? How about the post "Read This Before Posting"? | |
Re: [QUOTE=invisal;527290] // I haven't test this code, ...[/QUOTE] Then you shouldn't be posting it. There's nothing worse that helping someone with code that doesn't work. (well, yes there is, but you get the idea :-) | |
Re: [QUOTE=Michael_Knight;525467][B]Require Positive Reputation Comment[/B] - Members must leave a comment in order to give a post positive reputation.[/QUOTE] IMAO, [I]all[/I] reputation should have a comment. I want to know why I got neg-rep more than pos-rep. Pos-rep I can figure out usually. | |
Re: [QUOTE=Metalsiege;527718]Hey everyone.. I'm having a little problem with something I'm writing for a class.. I'm supposed to use while and a nested IF statement in the solution, but every time I run it I get the following back: [quote]Run-Time Check Failure #3 - The variable 'A' is being used without … | |
Re: When you read the Rules as requested upon signing up, what part of using CODE tags was unclear? Or even the post titled "[I]Read this before posting[/I]"? | |
Re: [QUOTE=yagiD;527070]Another one for a guaranteed result; [code]system("pause");[/code][/QUOTE] That is not guaranteed for the reason [B]neik_e[/B] mentions. And it's a very BAD solution! [url=http://www.gidnetwork.com/b-61.html]See this[/url] | |
Re: Calculate the value of [I]t1[/I] and [I]t2[/I] then divide them. [I]Your[/I] post has all the information you need. | |
Re: [QUOTE=prljavibluzer;518047]The main point is to use some of the sorting algorithms. Any suggestions, ideas, pseudocoding since I am newbie?[/QUOTE] Do a search for [I]Bubble Sort[/I]. It's the easiest to understand and for the small amount of data you need it should be more than adequate. | |
Re: [QUOTE=winrycool;522422]i would like to add graphics to to the "8 queens problem" with a 8*8 grid colored in black and white with the 8 queens placed on the board and moving them using the arrow keys is that possible plz help me it is counted for my annual exam i've … | |
Re: [QUOTE=rizrash;477895]i`ve a question regarding stack and queue...[/QUOTE] So start your own thread, don't hijack someone else's thread. [QUOTE=rizrash;477895]its as to implement queue and stack on these data: 23,34,56,67,89,90 using linklist....can anyone tell me how to begin..[/QUOTE] Read the rules and other important sticky posts, make your own thread, and tell … | |
Re: [code]while((answer != english1) || (answer != english2)) { [/code] It is guaranteed that one of the two comparisons is TRUE if [I]english1[/I] and [I]english2[/I] are not identical. Therefore the [ICODE]while[/ICODE] is always TRUE. | |
Re: [B]DangerDev[/B] Not only do we not do other people's homework for them, we try to 1) [I]help[/I] them come up with their own answers 2) use [B]good[/B] code. What the h*** is [icode]mul = (int)pow((double)base,(double) i++); [/icode]:icon_question: What's wrong with a simple [ICODE]r = (r * base) + digit;[/ICODE]:icon_question: What … | |
| |
Re: [QUOTE=Ancient Dragon;522066]>>do they contain anything in difference ??? Yes -- and IDE and a compiler and not the same thing. Is a dog and a monkey the same kind of animal? [/quote] Better analogy: Car engine vs. vehicle itself. The same engine (compiler) can be put into multiple cars (IDE). … | |
Re: Also, [url=http://www.gidnetwork.com/b-38.html]format you're code[/url], please... | |
Re: Also, [QUOTE=francisprite;522090]I've initialized the string "sym" to have the values '0' and '0'. [/quote] Then it's not a [I]string[/I], it's a character array. [I]string[/I]s must end with '\0' (or 0). [QUOTE=francisprite;522090]I then call the function "cnvrt" and use "sym" in the parameter(not so sure if that's the right term) of … | |
Re: [QUOTE=shadowfire36;519510]can any one show me the code im suppose to be using and why ???[/QUOTE] Isn't that a "[I]please do my homework for me[/I]" question? We frown upon that. You need to ask for help and explain why you are stuck -- what is it you don't understand. And learn … | |
Re: Write a program the outputs [INLINECODE]sizeof([I]type)[/I][/INLINECODE] to display the size of each type in bytes. Then multiply by 8 for bits. For example [INLINECODE]sizeof(char)[/INLINECODE] will probably output 1. | |
| |
Re: Guidance #1: Don't bump your thread ten minutes after you post. Most of us have lives ouside of this forum Guidance #2: Learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. I for one refuse to read code that I can't follow because of improper formatting. Guidance #3: Read THE RULES as you were … | |
Re: That depends completely on how you set up the card data. The way I'd do it probably won't work for you. | |
Re: [QUOTE=rama52;520342]plz help me[/QUOTE] With what? A program someone else was writing in 2004? Get real! | |
Re: [QUOTE=Ravenous Wolf;489413]@scru other than maybe spelling mistakes i dont see what i did wrong. computers remove from humans the need to consult dictionaries. unfortuanately that is not true on daniweb. anyway. that is redundend at this point. i was just pointing out that one could not readily understand what he … | |
Re: Since an int defaults to decimal on input, and the largest value an int can hold is less then 5,000,000,000 it's no wonder entering more than that doesn't work. You can change your code to enter a string instead an int and process the number character by character. | |
Re: Yep, it's rubbish. What you've posted is not enough for us to really help. You don't tell us what the variable types are so we have to guess. You don't have a default case but you claim you want to use one. And what that loop is supposed to do … | |
Re: [QUOTE=kako13;514587][code=cpp]CODE[/code] That should work...[/QUOTE] You should try testing your code before posting. That way you can actually say "[I]that [B]will[/B] work[/I]", and your code will in fact work. What you posted is an useless loop, so it can't possibly work... And use CODE tags! Read the Rules. | |
Re: [QUOTE=Ancient Dragon;519457]what operating system will this program run on ? and what compiler are you using. [/quote] [QUOTE=programmingnoob;519438]WE use kiel microvision...[/QUOTE] Keil is a firmware compiler, so the program [I]is[/I] the system. [QUOTE=Ancient Dragon;519457]I guess there is probably something else such as another thread that does something with P1 to … | |
Re: [QUOTE=nurulshidanoni;512085]but how can the c++ detectthat the data is student id and examcode?[/QUOTE] Please take care in your posts. [I]detectthat[/I]? [I]foleslike[/I]? C++ cannot determine what type of data it sees. You have to determine what the data differences are and program the code to understand the difference. | |
Re: [QUOTE=jonathanasdf;518840]Hehe. I tried googling this, but all I've come up was Visual C++ results. How would I go about reading from a VERY VERY basic ini file in console C++ Using DevC++?[/QUOTE] Why would VC be different than DEV? Open the file Read a line Figure out what the line … | |
Re: [QUOTE=DesiShaddy;518767]Can please post the code, If you are done with the problem............ I am working on some what similar problem for one of my assignment :)[/QUOTE] Maybe you should read the rest of the thread to learn how the problem was solved rather than asking someone to post their solution … |
The End.