Posts
 
Reputation
Joined
Last Seen
Ranked #255
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
87% Quality Score
Upvotes Received
15
Posts with Upvotes
13
Upvoting Members
13
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
13 Commented Posts
~45.7K People Reached
About Me

Student

Favorite Forums
Favorite Tags
Member Avatar for Duki

Cookies and milk - I ordered a pizza but I'm too hungry to wait without eating :P

Member Avatar for Dani
22
17K
Member Avatar for badmofo

I'd do it that way too, just I'd add a little if-else-abs() trick to handle n<0 (otherwise it would print -567 reversed as -7-6-5). something like [CODE=C++]if(n<0) { cout << "-" << abs(n%10); revprint(n/-10); } else { cout << n%10; revprint(n/10); }[/CODE]

Member Avatar for Ali_40
0
875
Member Avatar for mrboolf

Hi all there. Firstly I apologize if this is not a specific question (please do point it out if you find this unpolite). I don't have real problems so if you're not personally interested feel free to save your time and close this thread :) Anyway, I had to write …

Member Avatar for jsdncjnsci
1
447
Member Avatar for akira_shinizaki

[QUOTE=Narue;725597]Or you can just turn in something that will shut your teacher up, like this: [code=cplusplus] #include <iostream> int main() { for ( int i = 0; i < 32; i++ ) { for ( int j = 0; j <= i; j++ ) std::cout.put ( ~i & j ? …

Member Avatar for kvprajapati
0
258
Member Avatar for rees90

It's not that difficult to implement one by yourself: [CODE=C++]double myfabs(double x) { if(x>=0) { return ***; } else { return ***; } }[/CODE] It should be easy for you to figure out what you have to return in each case ;-)

Member Avatar for VernonDozier
0
181
Member Avatar for VernonDozier
Member Avatar for sneekula
2
483
Member Avatar for orwell84

If a function returns, say, an int, you can use a call to that function in every place you could have used an int. Examples: [code=c++]#include <iostream> int sumFunction(int a, int b) { return a + b; } int main() { int a = 5, b = 7, c = …

Member Avatar for orwell84
0
158
Member Avatar for jimbob90

[ICODE]getline(cin, line);[/ICODE] Shouldn't you take your line from the ifstream? What daviddoria meant with the add function is that you are every time rewriting the file instead of just adding lines. Also you are not closing anything. Edit: You declare [ICODE]ifstream a;[/ICODE] in main but you make no use of …

Member Avatar for deepglue555
0
179
Member Avatar for guest7

Sounds like a subset generating problem to me. I did almost the same thing a while ago, try reading [URL="http://www.daniweb.com/forums/thread159859.html"]this[/URL]. Hope that helps.

Member Avatar for MosaicFuneral
0
417
Member Avatar for harryoma

You could use [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html"]atoi[/URL] or write your own char-to-digit converter, like this: [code=c++]int char2int(char c) { switch(c) { case '0': { return 0; } case '1': { return 1; } // ... and so on } }[/code] You could also do it without the switch, but I'll let you figure …

Member Avatar for ddanbe
0
209
Member Avatar for mrboolf

Hi all there. Given the huge amount of blackjack/card games threads and me being personally interested in poker and other games, I was feeling like starting to play with a few useful (at least I hope so) classes for dealing (no pun intended :P) with card games. I started my …

Member Avatar for Murtan
1
523
Member Avatar for Manutebecker

Check out [URL="http://www.daniweb.com/forums/post755264.html"]this[/URL], I hope it'll help :-) It's still work in progress though there are some changes made...

Member Avatar for ArkM
0
262
Member Avatar for iannemic

No. We won't do your homework for you. Read the forum rules, post [b]your[/b] attempt and [b]then[/b] ask for help (specifically). Make sure you use code tags.

Member Avatar for mrnutty
-2
128
Member Avatar for nitro

[QUOTE=ninja_gs;758769] JUST LOOK AT NAURE 's ATTITUDE [COLOR="Red"]"I'm here to prove you wrong"[/COLOR] So All Ppl Just think of it [COLOR="Red"]s(he) is Not here To Motivate or Help s(he) is Here to Make you comment and prove you are Wrong.. [/COLOR][/QUOTE] Here: [quote=Plato on Gorgias]And what is my sort? you …

Member Avatar for AHUazhu
1
140
Member Avatar for Salem

Astonishing ignorance. Thanks for posting, I'm waiting to read Chapter 2 [quote]It looks like we will get to meet in his office when School starts again after the holiday. I am anxious to meet a person who is this uninformed and still holds a position of authority and learnedness over …

Member Avatar for VernonDozier
0
140
Member Avatar for anbuninja

Either that or [code=c++]for(int month = 0; month < numYears*12; month++) { std::cout << "Enter rainfall (in inches) for month " << (month%12) + 1 << " of year " << (month/12) + 1 << std::endl; // do what you want }[/code] This assuming I understood your question. Please read …

Member Avatar for deviantrunner
0
181
Member Avatar for callprem26

1. Are you allowed to use recursion? If so it's easy. 2. Please use [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags[/URL] when posting code.

Member Avatar for Narue
0
178
Member Avatar for micky692002

Read [URL="http://www.daniweb.com/forums/announcement8-2.html"]this[/URL] closely. No one is going to post-fed you a solution to [b]your[/b] homework, so show some effort or prepare to be ignored. After all it's [b]your[/b] programming class, not ours.

Member Avatar for Murtan
0
3K
Member Avatar for Undermine

Maybe [URL="http://www.daniweb.com/forums/thread161832.html"]this thread[/URL] will help (it's still "work in progress" but may give you some ideas) Hope this helps.

Member Avatar for mrboolf
0
109
Member Avatar for freelancelote
Member Avatar for Narue
0
146
Member Avatar for gunsmith2112

I you would like to keep track of previous executions of your program I suggest you to write these informations in a file - you can't keep an array from one execution to another afaik Oo

Member Avatar for mrboolf
0
139
Member Avatar for mrboolf

[URL="http://www.castpuzzle.net/english/index.html"]castpuzzle.net[/URL] My brother just brought me one from Munchen and I went crazy about it :P This is mine: [URL="http://www.castpuzzle.net/english/castpuzzle/radix.html"]Cast Radix[/URL]. I found it to be a little more difficult than I thought at first (it's level 4) but I managed to take it apart and then assemble it again …

0
78
Member Avatar for GrimJack
Member Avatar for freelancelote

[code=c++]string myFile("rawDictionary2"); int totalWords= wordCount(myFile);[/code] you are sending in a string, why do you want it to accept an ifstream?

Member Avatar for Freaky_Chris
0
214
Member Avatar for singhraghav

Also: why do you check i? Instead of [ICODE]if(i=='m' && 'male')[/ICODE] try [ICODE]if(s=="m" || s=="male")[/ICODE]. First correct your toLowerCase as AncientDragon suggested, then fix "minor" things like the one I pointed out to you (and others like double s input)

Member Avatar for unbeatable0
0
100
Member Avatar for elitedragoon

State_Tax is expecting float, you are passing float*. Change [ICODE]*statetax = State_Tax(federaltax);[/ICODE] to [ICODE]*statetax = State_Tax(*federaltax);[/ICODE]

Member Avatar for elitedragoon
0
731
Member Avatar for shankhs

From the link you posted: [quote]A naive algorithm for finding palindromes calculates all positions of an input array, and for each of those positions, calculates the length of the longest palindrome around that position.[/quote] That shouldn't be much difficult to implement, and [quote]For each position, this function may take an …

Member Avatar for cikara21
0
150
Member Avatar for jasimp

A similar thing happened in Genova, Italy, during 27th G8 summing in 2001. A policeman shot dead a masked guy who was throwing him a fire extinguisher [URL="http://notimaz.blog.kataweb.it/files/photos/uncategorized/carlo4_1.jpg"](photo)[/URL]. You can see it in the act of assaulting the officer inside the car (from where he fired). There's still a really …

Member Avatar for jbennet
0
226
Member Avatar for The Dude

[QUOTE=Salem;749893]> He also will undergo a psychiatric evaluation. Yup, faith is a mental illness - in all it's forms.[/QUOTE] Great, I completely agree. Lol for the rest of your post :-S

Member Avatar for Jen0608
0
186
Member Avatar for The Dude

Everlast - Love, War and the Ghost of Whitey Ford. A new entry in my collection - I really like it so far Next one in playlist is Ellen Allien & Apparat - Orchestra of Bubbles

Member Avatar for Jen0608
0
128