Posts
 
Reputation
Joined
Last Seen
Ranked #67
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
84% Quality Score
Upvotes Received
518
Posts with Upvotes
443
Upvoting Members
244
Downvotes Received
104
Posts with Downvotes
86
Downvoting Members
52
171 Commented Posts
~1.35M People Reached
PC Specs
Computers
Favorite Tags
c++ x 3K
java x 97
c x 84
Member Avatar for vegaseat
Member Avatar for Reverend Jim
15
13K
Member Avatar for 3cats

Since you are already using std::string, I figure to help you concise this function : [code] //method to check if the current character is a vowel bool IsVowel(char chr) { switch (chr) { case 'A': case 'E': case 'I': case 'O': case 'U': case 'Y': case 'a': case 'e': case …

Member Avatar for Mahim_1
0
2K
Member Avatar for Dmiller071
Member Avatar for oussama_5
0
224
Member Avatar for din_hilmi

1) Why ? 2) need compile time variable meaning there will be a fixed amount of inputs to get 3) Need to implement your own sorting method and use it inside main, so technically it won't be a function. If not then you will need a lot of if/else or …

Member Avatar for Aditya_47
0
44K
Member Avatar for JoBe

You can prove this by giving just 1 simple example. No need for general proof, because if it can't work for even 1 case, then its incorrect.

Member Avatar for Alfonso_4
0
853
Member Avatar for pags920

First off, this code : [code] #define false 0 #define true 1 char s[100]; char sr[100]; [/code] Is bad already. You do not need to use define. C++ already has, "true" and "false" defined. Next : [code] int main(){ InputString(); system("PAUSE"); return 0; } [/code] No need to use a …

Member Avatar for gravity_1
0
2K
Member Avatar for Jiwe
Member Avatar for networkZombie

The key idea is to use the [URL="http://en.wikipedia.org/wiki/Modulo_operation"]modulo operation[/URL]. For example [icode]if(num % 2 == 0){...}[/icode] means that [i]num[/i] is evenly divided by 2, thus checks if num is even. Use that idea. Your algorithm is more complicated than it needs to be.

Member Avatar for memson
0
516
Member Avatar for restrictment

>> And it's kinda the whole point of C++ No its not. C++ != OOP. C++ has OOP, but does not mean C++ is OOP.

Member Avatar for emeraldamerican
0
6K
Member Avatar for super-duper

Just a quick explanation on [B]Abstract [/B]Data Type(ADT) [b]WHO[/b]: Abstract Data Type [b]WHAT[/b]: Abstract Data Type are data-type that combines the common functionalities from different related objects into one package, so that those different but related object's interface can inherit from the ADT thus making it more flexible and and …

Member Avatar for rucha_1
0
2K
Member Avatar for stefy14

>>[B]I want to my program to prompt user to input a number with three or more integers [/B] You know how to get the user input into a variable right ? [code] int var1 = 0 , var2 = 0, var3 = 0; cin >> var1 >> var2 >> var3; …

Member Avatar for amisha_1
0
57K
Member Avatar for Member 785072

[QUOTE=Nick Evan;1268790][B]>>If there are three logic bugs in total and one's down, two are left. [/B] Holy shit. That's some amazing math! Although you obviously think otherwise: I'm not stupid. I was asking [I]where[/I] the two remaining errors are.[/QUOTE] I think he got this code from the book. And the …

Member Avatar for Matic_1
0
971
Member Avatar for qqwushi12345

Of course we're not gonna do this, unless you pay me $20.00 dollars for this problem. But to start you off, this is the quadratic equation : [code] x = -b/(2a) +- sqrt(b^2 - 4ac) / (2a). [/code] Since they gave you a,b, and c. You just have to plug …

Member Avatar for mohanned_2
0
4K
Member Avatar for Sudo Bash

Bad naming, time is already defined in ctime [code] #include <iostream> #include <ctime> using namespace std; int main() { clock_t start = clock(); cout << "press enter..."; cin.ignore(); clock_t finish = clock(); double doneTime = float(finish-start)/CLOCKS_PER_SEC; cout << "you took " << doneTime << " seconds\n"; return 0; } [/code]

Member Avatar for Yangang
0
4K
Member Avatar for restrictment

Piece of cake, kinda crude approximation tho. [code] #include <iostream> #include <cmath> #include <string> #include <vector> using namespace std; const unsigned CANVAS_WIDTH = 20; const unsigned CANVAS_HEIGHT = 20; const unsigned char BACKGROUND_FILL = '#'; const char POINT = '*'; const float PI = 3.14159265f; const float DEGREE_TO_RADIAN_FACTOR = 0.0174532925f; …

Member Avatar for CharlieCap
2
2K
Member Avatar for kylcrow

A problem I see by the suggested solutions so far that is, it is inefficient if one calls the function numerous times. So in the long run it will probably be better to read it into a vector and use that vector to extract lines. That way you get rid …

Member Avatar for zia shaikh
0
5K
Member Avatar for thehivetyrant

That's why people shouldn't jump too early into graphics without good knowledge of the basics. Ball is a function. It is not a class nor a struct. Thus you cannot use the dot operator on ball. A easy way to get the ball to move is by doing something like …

Member Avatar for Hasan_4
0
6K
Member Avatar for vegaseat

Royal blue, bought my first car last summer. 2007 tiburon GT. Sexy little self. Got it for a bargin too. 21K miles for 8G.

Member Avatar for rockingjohncart
0
333
Member Avatar for violet101

For part a) make a copy. For that copy, uppercase the first letter. Print it backwards. For part d) make a copy. Swap certain positions. Print out the copy backwards.

Member Avatar for larz_1
0
586
Member Avatar for William Hemsworth
Member Avatar for rythreion

If you know how to convert from base 10 to base 2, then you know how to convert from any base to any other base. So the question remains, do you know how to convert from base 10 to base 2?

Member Avatar for NathanOliver
0
4K
Member Avatar for vjcagay
Member Avatar for ilovec++

a) In a 32-bit system, a reference variable needs at least 4 bytes of memory and in a 64-but system, it needs at least 5 bytes. That's because a reference points to the memory of the variable its pointing to. Thus it needs only enough memory to store a memory …

Member Avatar for yoavip
0
564
Member Avatar for myk45

Data Abstraction means something like this : //Shape provides no implementation of the draw functions //It abstracts the draw function from other shapes meaning that it //defines functions that all type of shapes should necessarily have. class Shape{ public: virtual void draw()const=0; }; class Ellipse : Shape{ public: void draw()const{ …

Member Avatar for naaz.kaushik.3
0
873
Member Avatar for olelink

You can use your browser and setup an autofill option, so that when needing to fill out a form, the browser can try to autofill it. Other than that, you need to justify why you would want to do this.

Member Avatar for nittu sarathe
-2
571
Member Avatar for SpS

[code] int i = 0; while(!cin >> i) { cout<<"\nNot valid Try again : "<<endl; cin.clear(); while(cin.get() != '\n') ; } cout<<"Valid\n"; [/code]

Member Avatar for VikyTushar
0
841
Member Avatar for IT seeker
Member Avatar for themaestro

Its not possible to do this with just C++. But you can approximate it like so : [code] #include <iostream> #include <string> #include <ctime> using namespace std; int ask(const string& question){ cout << question; int ans = 0; cin >> ans; return ans; } int main(){ const int MAX_TIME_LIMIT = …

Member Avatar for viorel994
0
3K
Member Avatar for debasisdas

"Shake sphere game us to be or not to be ", computer gave us 0xFF" -------------------- 2B|~2B = 0xFF --------------------

Member Avatar for James_28
8
16K
Member Avatar for mrnutty

Me? Oh nothing much, just bored at work. Working on a new web-app project on my free time. Planned to be in the appstore. Going to hit #1, just watch. How about you?

Member Avatar for GrimJack
0
283