Posts
 
Reputation
Joined
Last Seen
Ranked #237
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
92% Quality Score
Upvotes Received
62
Posts with Upvotes
48
Upvoting Members
31
Downvotes Received
4
Posts with Downvotes
3
Downvoting Members
4
22 Commented Posts
~126.51K People Reached
Interests
Algorithm development
PC Specs
Ubuntu and RHEL
Member Avatar for stefy14

There is actually a very simple solution to this problem. First, you are trying to do two things here: [icode] 1. Split an input number into separate digits. 2. Add the digits together. [/icode] First of all, I would not recommend putting your input into an int type. If you …

Member Avatar for amisha_1
0
57K
Member Avatar for dolly_olaide

The basic problem with detecting bodies is the inconsistency of orientation. You'll notice that the Face detector is really only good at detecting faces that are pointed more or less toward the camera, and the detector does not find rotated faces well. This is because it is looking for similar …

Member Avatar for dddua
0
811
Member Avatar for kumar2884

[QUOTE=kumar2884;1132180] But if we need to create a application for a particular device like mobile or digital camera we need to write in C or C++ with out using this libraries and it will take 100 to 200 likes depending up on our requirements is it right ? So all …

Member Avatar for naveenture
0
516
Member Avatar for dusktreader

I am having some trouble getting some overloaded operators working correctly with a simple inherited Vector class (numerical vector, not container) The scalar multiply from the base class doesn't appear to be visible to the derived class. Code follows: Base Class Header [code=c++]#pragma once #include <vector> class Base { protected: …

Member Avatar for GreenRiver
0
3K
Member Avatar for Silvershaft

I'm a huge fan of Qt. I build a lot of Qt applications, and I'm really happy with this GUI. Trolltech, the makers of Qt, also provide a full-featured integrated IDE called [URL="http://qt.nokia.com/products/developer-tools/developer-tools"]QtCreator[/URL] that I actually use for my general purpose c++ coding. Qt is very flexible, has tons of …

Member Avatar for Stefano Mtangoo
0
369
Member Avatar for kirennian

I haven't used them before, but I know a lot of people use [URL="http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation"]quaternions[/URL] to calculate 3 axis rotations. Apparently they compose better than using Euler angles. Have a look. Like I said, I haven't used them, but they might be what you are looking for.

Member Avatar for dineshguru
0
994
Member Avatar for neural_jam

What it appears to me is that you have a specialized base-5 numbering system. It is specialized in that it has rules that dictate how you count down in this system. You could make this system very extensible and have it work with an arbitrary number of digits and arbitrary …

Member Avatar for neural_jam
0
2K
Member Avatar for frogboy77

You have a few problems: 1. This is a recusion problem, but you are not recursing correctly: [code] int g_c_d(int a,int b) { int c; c=abs(b-a); cout<<a<<" "<<b<<" "<<c<<endl;/*put this in to check it was going ok*/ if(c==0){return a;} if(b>a){b=a;} a=c; g_c_d(a,b); [B][COLOR="Red"]// This value should be returned[/COLOR][/B] }[/code] 2. …

Member Avatar for frogboy77
0
121
Member Avatar for RFID46616c73

[QUOTE=LordNemrod;1326996]Die::Die() //Initializes Face data member { Face = 1,2,3,4,5,6; } I am not sure what you wanted to achieve by this, but this assigns 6 to Face. The operator comma works like this - it evaluates all of its arguments from left to right then returns the rightmost argument, in …

Member Avatar for RFID46616c73
2
978
Member Avatar for nizbit

[QUOTE=nizbit;1320079]I'm trying to find duplicates in an array and removing them by shifting the array index using the same array. I can't figure out where in my code the problem is but I'm still getting a duplicate. Could someone please help pinpoint the problem? I've tried debugging it but I'm …

Member Avatar for dusktreader
0
536
Member Avatar for Sinaru

This is unnecessary code: [CODE] bool Candidate::operator ==(const Candidate& right) const { //return (firstName == right.firstName && lastName == right.lastName); // Rather than the above, I used this... return (static_cast<Person>(*this) == static_cast<Person>(right)); } [/CODE] If you do not define this operator in your derived Candidate class, the operator function from …

Member Avatar for arkoenig
0
164
Member Avatar for myk45

I think the best way to achieve this is to wrap the functionality of a bitset with custom functions. So, to extend your bitset: [code] class TryBits { // whatever other functionality public: extend( const string& ns ) { // insert a check for ns to be a valid bit …

Member Avatar for myk45
0
3K
Member Avatar for grahf23

[QUOTE=Fbody;1319894]On this site, a "space" or 2 is sufficient indent. A [I]TAB[/I] is too big.[/QUOTE] Actually, you shouldn't have actual tabs in your code. That is my opinion, and it is right. Code editors use monospace fonts ( at least they should, for the love of Turing ). Tabs are …

Member Avatar for grahf23
0
152
Member Avatar for tennis

[QUOTE=tennis;1320858]say iter1 and iter2 are both iterators [CODE]*iter1++=*iter2++;[/CODE] what does this line means? Can anybody help explain? ++ and * which is done first? thanks[/QUOTE] [URL="http://www.cppreference.com/wiki/operator_precedence"]Here's a page that will be very helpful![/URL] Operator precedence in c++ is important, but I prefer explicit code to implicit trickery. Parentheses are your …

Member Avatar for Duki
0
89
Member Avatar for senthamizh

Yes, this code is broken. First, receive is not declared in the main function. You must first declare an object of type [B]bank[/B]. Secondly, you won't be able to use strcpy to write data directly into the c-string bank::receive unless you make a dangerous assumption. Most compilers place the private …

Member Avatar for dusktreader
0
142
Member Avatar for helpme87

**oh and i am using dev-c++ so i cant use strings** You should really consider using something besides dev-c++. Code::Blocks is a common suggestion. You should also know that dev-c++ isn't a language or a standard, so, aside from convenience for the classroom, it has no crucial place in the …

Member Avatar for mrnutty
0
146
Member Avatar for rowley4

Hrmmmmmmm... 1. Why do you need a [I]screenshot[/I]????? I really have to wonder why you would need a screenshot of a running application. I bet it has something to do with my second question: 2. Is this a homework assignment? This is the time of year when computer science classes …

Member Avatar for rowley4
-1
165
Member Avatar for harris21

[QUOTE=Narue;1317680][B]>So in my view, I'm still right[/B] ...[/QUOTE] Righteous indignation is as heavy a cross to bear as defending an invalid thesis. @Mike She got you. You should at least admit it. @Narue You may be right, but I don't completely agree. One of the benefits of using pure virtual …

Member Avatar for mrnutty
0
732
Member Avatar for harris21

@Narue Because of perverse curiosity, I must know. When and why have you used placement new before? Perhaps a hardware interface?

Member Avatar for mrnutty
0
286
Member Avatar for Stony

[QUOTE=tayyab569;1317718]#include <iostream.h> #include <conio.h> void main(void) { clrscr(); int i,p; for(i=1;i<=300;i=i+1) { for(p=2;p<i;p=p+1) { if(i%p==0) break; else continue; } if(i==p) cout<<" Prime:"<<p; } getch(); }[/QUOTE] [COLOR="Red"]What the #&&$*% is this?[/COLOR] [B]1. [iCODE]void main()[/iCODE] is a great way to start fail code[/B] Please, for the love of any deity, use int …

Member Avatar for dusktreader
0
234
Member Avatar for Duki

This should work: [code] int s = b.Activate(war.get_tp(), damage, 50); //prototype int Activate ( [B]const[/B] int &tp, int weaponDamage, int attack ); [/code]

Member Avatar for Duki
0
176
Member Avatar for laughnan

I wouldn't use getline for this. If you do so, you must take responsibility for tokenizing the lines and converting string data. The iostream library can do this automatically for you, so using ifstream and the >> operator is correct. My guess is that you are reading all of the …

Member Avatar for Kanoisa
0
4K
Member Avatar for Nathaniel10

[code] void randnum(double lower, double upper, int n) // Generate 'n' random numbers uniformly distributed { // between lower and upper limits. double a = 0; double b = 0; srand((unsigned)time(0)); for (int i = 1; i < n+1; ++i) { a = rand(); b = lower + (a / …

Member Avatar for mrnutty
0
180
Member Avatar for mimis

This definitely sounds like a job for a class not a struct. I'm surprised at the mixture of the STL with a struct that requires specific functionality. Is this an assignment for a class? If so, I wonder why your teacher isn't asking for a class with overloaded operators.

Member Avatar for mrnutty
0
161
Member Avatar for ontherocks

Understanding pointers is [I][B]CRITICAL[/B][/I] to mastering C and C++. You should really go out onto the internet and read about pointers. You should work through some tutorials and examples. There is a lot of core concepts in pointer management. I don't think it would be appropriate to discuss it all …

Member Avatar for ontherocks
0
126
Member Avatar for xavier666

You could use the strcpy() function to acquire this functionality: [quote][code] int i; for(i = 0; i < length; i++) { strng[i] = str[i]; } [/code][/quote]

Member Avatar for xavier666
0
141
Member Avatar for aikiart7

This should work. Your function's definition matches your function's declaration. Your function's call matches both. Dev C++ causes problems and has compatability issues. Basically, it sucks and doesn't work well with established standards. You should consider getting a new IDE and compiler toolchain. I've heard that [URL="http://www.codeblocks.org/"]Code::Blocks[/URL] is a nice …

Member Avatar for aikiart7
0
220
Member Avatar for Nathaniel10

[QUOTE=Nathaniel10;1311293]Thank you very much for your suggestions, Vijayan. I hadn't thought that having different classes for different exceptions was an appropriate formulation.[/QUOTE] I respectfully disagree. I believe that different exception types should have different class definitions. This paradigm is used extensively in many C++ libraries. I do agree that you …

Member Avatar for Nathaniel10
2
137
Member Avatar for mike42intn

[QUOTE=mike42intn;1310686] [CODE] char sentance[40]; int i = 0; srand((unsigned)time(NULL)); for( i = 0; i <= 20; i++) { strcat_s(sentance, article[rand()%5]); strcat_s(sentance,noun[rand()%5]); strcat_s(sentance,verb[rand()%5]); strcat_s(sentance,preposition[rand()%5]); strcat_s(sentance,article[rand()%5]); printf("\n\n%s\n\n'", sentance); } } [/CODE][/QUOTE] My guess is that you are overrunning your sentence array. First, you should make it larger. 40 characters probably won't consistently …

Member Avatar for mike42intn
0
228
Member Avatar for jasleen12345

You really need to post code demonstrating your problem. We have good imaginations, but this is a little sparse....

Member Avatar for dusktreader
0
82