244 Posted Topics
Re: i think if you are going to have more than one statement after an [B]if[/B] then curly braces {} should be used(i.e line 19 to line 20, 23 to 24 and 27 to 28). I'm also a bit wary of the return main line. | |
Re: you have 2 functions that are named the same and take the same argument. | |
Re: Surely the method mentioned by the OP would show sum to be 15. This is not is what you are looking for(at least i think). stringstream may be the way to go. | |
Re: 1. use code tags. 2. if you are being asked for pseudocode then i am guessing your prof doesn't think you are ready for the actual code yet. 3. is this your code? 4. google. edit: it just appeared in code tags 3. i.e can you explain what the code … | |
Re: Is this your work? | |
Re: [URL="http://en.wikipedia.org/wiki/Compound_interest"]http://en.wikipedia.org/wiki/Compound_interest[/URL] | |
Re: Lady Astor: 'If you were my husband, I'd poison your coffee!' Churchill: 'My dear, if you were my wife I'd drink it.' | |
Re: 1) yes, but be prepared for a very steep learning curve. 2) as far as i am aware a large percentage of modern games are written in c++ (but remember writing a game may not be as much fun as you think it will be, i.e lots of time writing … | |
Re: It appears to be the case of those who can, do, those who can't, teach. | |
Re: ok just guesses but line 14 why? do while signal !='q' initially what value does signal have? | |
Re: seek out your classmates. they are also here. | |
Re: can you use vectors? that would be my first port of call. then either use sort or write (what i think is called) a bubblesort. | |
Re: [QUOTE]If I have seen further it is only by standing on the shoulders of giants.[/QUOTE] Sir Isaac Newton | |
Re: That's a big ask. My suggestion would be to run the program with extra cout lines to find where the problem is occurring then post the smaller piece of code(that isn't working) for people to help you with. There are some here who may slog through ~250 lines, but not … | |
![]() | |
Re: As it says you have a double function so it is expecting a double value to be returned. Plus you seem to be missing some function definitions. | |
Re: OK, so what's the problem? | |
Re: That is a statement not a question. | |
Re: perhaps you should get together with biancaW here; [URL="http://www.daniweb.com/forums/thread344087.html"]http://www.daniweb.com/forums/thread344087.html[/URL] | |
Re: [QUOTE]Dev-C++ is [B]updated frequently [/B]and includes all of the library's you will probably ever use (using the new standards) [/QUOTE] [URL="http://en.wikipedia.org/wiki/Dev-C%2B%2B"]http://en.wikipedia.org/wiki/Dev-C%2B%2B[/URL] | |
Re: Does your compiler not have a problem with line 16(i.e declaring a variable twice)? | |
Re: cure step 1 - Find pint glass. step 2 - Fill with beer. step 3 - Drink contents of glass. step 4 - GOTO step 2. this should fix it. | |
Re: I would suggest posting less code and a specific question about what you are looking for. | |
Re: [CODE]a=4596; b=(((a/100)%10)+((a/1000)*10)+((a%10)*100)+(((a/10)%10)*1000));[/CODE] may work but arrays or strings would be easier. | |
[CODE]bool is_prime(int a) { if(a==1){return false;} if(a<4){return true;} if(a%2==0){return false;} if(a<9){return true;} if(a%3==0){return false;} int i; for(i=5;(i*i)<=a;i+=6) { if(a%i==0){return false;} if(a%(i+2)==0){return false;} } return true; } [/CODE] critique welcome. | |
Re: If you want any help (and you do from the above poster) then an amount of effort shown really is required. | |
Re: i believe this line [CODE]while (pick != 'r' || pick != 'g' || pick != 'b');[/CODE] should be [CODE]while (pick != 'r' && pick != 'g' && pick != 'b');[/CODE] | |
Re: If room 5 doesn't exist the home may smell rather "funky". Lighting would be the least of your problems. | |
Re: would this do it? [CODE]if(iWhole/10000==iWhole%10&&(iWhole/1000)%10==(iWhole/10)%10){is_pal=true;} else{is_pal=false;}[/CODE] | |
Re: [URL="http://http://www.cprogramming.com/begin.html"]http://http://www.cprogramming.com/begin.html[/URL] | |
Re: see this [URL="http://www.daniweb.com/forums/thread78223.html"]http://www.daniweb.com/forums/thread78223.html[/URL] particularly point 4. | |
| |
Re: would unsigned long long int(instead of int) suffice? | |
Re: 1,132,345,679 exactly at time of posting. P.S my wife's computer just blew up so subtract 1. | |
Re: no problem you can have my old one but it is buyer uplift only. | |
Re: see this thread [URL="http://www.daniweb.com/forums/thread318047.html"]http://www.daniweb.com/forums/thread318047.html[/URL] | |
| |
Re: don't know of a clever way but using 2 arrays would work. read into array1 then into array2 then have a loop which adds the value in each part of array2 to each part of array1 then output array1. | |
Re: [QUOTE]answer immediately please [/QUOTE] strange phrase. what seems to be an order followed by a plea???? | |
Re: You keep pencils in a beerstein? Germany and myself are appalled. | |
Re: You may recieve more help if you clearly state your problem. i.e what do you expect your program to do and what is it doing wrong. P.S USE CODE TAGS. | |
Re: Am just a newb so this may be a stupid question, but i don't understand line 58 [CODE]for (int b = -999; b < 1000; b = primes[index++])[/CODE] why not [CODE]for (int b = -999; b < 1000; b++)[/CODE] I've already done this but having looked at my code i'm … | |
Re: i think you need to seed rand. something like [CODE]srand(time(NULL));[/CODE] |
The End.