Posts
 
Reputation
Joined
Last Seen
Ranked #963
Strength to Increase Rep
+3
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
3 Commented Posts
0 Endorsements
Ranked #1K
~8K People Reached
Favorite Forums
Favorite Tags
c++ x 24
unix x 1
Member Avatar for dotnabox

How about using cin.get() to get one character at a time, verifying that the order is digit, digit [convert to int and check range], colon, digit, digit [convert to int and check range], end-of-line. Maybe ignore leading or trailing white space to be nice. Not sure how you're going to …

Member Avatar for VernonDozier
0
296
Member Avatar for the great

[QUOTE=the great;1037809]Hello ... It is not taking the inputs of name and address as it should. Got confused how to solve it. [/QUOTE] After the [ICODE]operator>>()[/ICODE], the input is left pointing at the end-of-line character. At the next call of [ICODE]get()[/ICODE], there is already input available (the end-of-line character), so …

Member Avatar for jonsca
0
83
Member Avatar for jerrytouille

I can't see an obvious explanation for why your second cout statement doesn't print anything. However, one flaw in this function is that the args[] and args1[] arrays must end with a 0 as their last element (a Unix requirement, not a C++ one) -- otherwise how does execvp() know …

Member Avatar for jerrytouille
0
204
Member Avatar for nick30266

[QUOTE=nick30266;1037878]can somebody help me with this program?? [...] find a path moving like a knight in chess game(L) that touch every point of the matrix once. ...[/QUOTE] Head start: from the current position, make a list of all the possible next moves that go to a position that hasn't been …

Member Avatar for boblied
0
117
Member Avatar for Phil++

Association can have lots of meanings. Any reference from one class to another is a kind of association. "Has-a" is one; it could also be "uses." "Has-a" is often called aggregation or composition. In terms of C++; it's commonly implemented by a member variable of the owned type, or by …

Member Avatar for boblied
0
150
Member Avatar for dotnabox
Member Avatar for dotnabox
0
261
Member Avatar for xfreebornx

The most direct way, since you've already included the algorithm header, is to use std::sort().

Member Avatar for mrnutty
0
112
Member Avatar for RonW56

Just guessing here, but rethink your break statements. Maybe you want to reorganize to find the matching ID, then break out of the loop and finish the location lookup. [code] bool found = false; for ( int c = 0; c < student_max ; ++c ) { if ( search_id …

Member Avatar for boblied
0
115
Member Avatar for ENCHTERP

You can return entire structures from functions. [CODE] Compass getCompass() { Compass result; result.C = make_pair(3,4); // etc. return result; } void someFunction() { Compass V = getCompass(); int j = V.C.first; // ... } {[/CODE]

Member Avatar for ENCHTERP
0
94
Member Avatar for pltndragon

At line 6, you declared showMedian to take a double parameter, but you implemented it to take a double *. At line 84, are you trying to call arrSelectSort again? If so, it doesn't need the types in its arguments. At line 90, you are checking a pointer to see …

Member Avatar for pltndragon
0
3K
Member Avatar for blackhawk9876

Couple o' things: Search has to return a pointer, so don't return info, return the pointer of the node you're looking at. The recursive call of Search() has to take the same parameters as the first call, so don't forget to pass key. That while loop at the end of …

Member Avatar for siddhant3s
0
107
Member Avatar for tgsoon2002

[code=syntax] std::string s; // ... code that reads from file into s ... if ( s.find("xxx") != std::string::npos ) [/code]

Member Avatar for boblied
0
65
Member Avatar for sciwizeh

[QUOTE=sciwizeh;844061] Hello, I have a question, when does a global variable get destructed? [/QUOTE] The compiler arranges for code to get executed both before main() is called and after it returns. Before main(), global constructors are called. After main(), global destructors are called in opposite order of their construction.

Member Avatar for ArkM
0
3K
Member Avatar for ganmo

> Hello, bool Set::operator==(const Set& b) const { if(b.header <= header && header <= header) //codes.... return true; } > Inside my overload for == which I use <= it doesn't use my overloaded version of <= instead it uses the standard version. Do I have to write a certain …

Member Avatar for ganmo
0
129
Member Avatar for daviddoria

For the purpose of sorting, any complete ordering will do. You could define a sort that uses x as primary key, y as secondary, and z as tiebreaker. [code] // Comparator function object to define less-than for Points struct PointLess { bool operator()(const Point& p1, const Point& p2) const { …

Member Avatar for daviddoria
0
210
Member Avatar for YingKang
Member Avatar for YingKang
0
266
Member Avatar for idb_study

Another use is to hold a collection of heterogeneous objects. For instance, if you have the classic example of things derived from Shape (triangle, circle, etc). If you make an array of Shape objects, then they are just base objects (not triangle etc). But if you make it an array …

Member Avatar for tux4life
0
152
Member Avatar for etserrano
Member Avatar for etserrano
0
153