Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #3K
~1K People Reached
Favorite Forums
Favorite Tags

11 Posted Topics

Member Avatar for altXerror

for that matter I'm pretty sure that the following is valid code: [CODE]int theMostAwesomestIntEver;[/CODE]

Member Avatar for mrnutty
0
160
Member Avatar for pistol-pete

Here's how I would go about it... [CODE] string word1 = "orchestra", word2 = "carthorse"; set<char> s; for(int i = 0; i < word1.size(); i++){ s.insert(word1[i]); } bool isAnagram = true; for(int i = 0; i < word2.size() && isAnagram; i++){ if(s.find(word2[i]) == s.end()) isAnagram = false; } [/CODE] The …

Member Avatar for jonsca
0
195
Member Avatar for macobex

It depends. There is no one best way to initialize a vector and the method you choose should fit the problem at hand. However, if efficiency is something which you want to place priority on, you should consider some of the other container types that are available. A vector uses …

Member Avatar for n.utiu
0
138
Member Avatar for tjlee87

Honestly I can't spend the time to find the exact error(s). Hopefully someone else can help you with that. But maybe a couple pointers could be helpful (no pun intended). As great as pointers are, they are really risky. The more pointers you use the greater the chances are for …

Member Avatar for tjlee87
0
111
Member Avatar for Asheem

This is an aweful lot of code for someone to read through looking for who knows what. You might get better responses if you narrow down the problem a bit and ask specific questions.

Member Avatar for WaltP
0
128
Member Avatar for timbomo

What you're dealing with here is a scope issue. An if block won't return anything in the sense that that a function would. If you want to retain a value determined within the block, you need to declare the variable which stores that value outside of it.

Member Avatar for Sumyungi
0
108
Member Avatar for Alicito

The code seems to work fine, except for the part where the list destructor is missing its implementation.

Member Avatar for Alicito
0
110
Member Avatar for allaboutdrew

On line 25, the three variables are set to 1, 1, and 2 because these are the first three numbers in a fibonacci sequence (not including zero). Roughly translated, line 30 would read: "initially set n to n - 3, then decrement n by one and execute some code so …

Member Avatar for allaboutdrew
0
202
Member Avatar for PTRMAN1

Sorry but the formatting just makes that horribly difficult to read. I did notice though that within your first loop you set compute = 'Y' instead of a comparison resulting in a boolean which should read compute == 'Y'. I hope that helps

Member Avatar for PTRMAN1
0
96
Member Avatar for misterjay3
Member Avatar for Sumyungi

Is there a way in C++ to handle unexpected errors? Other languanges I have learned tend to allow this but for some reason I cannot get the try/catch solution to work in all cases. Take the following example: [CODE] int main(){ vector<int> v; try{ //next line should cause an assertion …

0
59

The End.