CFanatic

Go Back   CFanatic > Programming > C++ Programming

Join CFanatic Forum Now

sorting question topic posted under C++ Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2006, 04:57 AM
Junior Member
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
John is on a distinguished road
| More
sorting question

I have a class

class Point2D {

double x[2];

public:
....

}

I want to implement a function that can take in as input point2Dsort( double * pdA, int number_of_points) and sort it in lexicographic order. (i.e. if p1.x() > p2.x() then p1 > p2 ...

Is there a way to define operator< on the point class and implement point2Dsort using c++ sort() function?

Thanks,
--j
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
newby hashtable question DariusC C# Programming 2 09-08-2008 02:43 AM
question about so files ftom2 C++ Programming 1 08-18-2008 02:28 AM
View vs. Control - question JackBeans MFC Programming 1 07-15-2007 10:30 PM
C# debatable question MartijnMulder C# Programming 2 01-06-2007 12:42 AM
Beginners Question on 'return' MartijnMulder C# Programming 1 12-08-2006 02:33 PM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 04:02 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board