Click here to Skip to main content
15,890,717 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: User interface problem -- check a point is inside a polygon or not Pin
Stephen Hewitt1-Jun-06 21:20
Stephen Hewitt1-Jun-06 21:20 
GeneralRe: User interface problem -- check a point is inside a polygon or not [modified] Pin
George_George1-Jun-06 21:50
George_George1-Jun-06 21:50 
GeneralRe: User interface problem -- check a point is inside a polygon or not [modified] Pin
Cedric Moonen1-Jun-06 21:57
Cedric Moonen1-Jun-06 21:57 
GeneralRe: User interface problem -- check a point is inside a polygon or not [modified] Pin
George_George1-Jun-06 22:09
George_George1-Jun-06 22:09 
GeneralRe: User interface problem -- check a point is inside a polygon or not [modified] Pin
Stephen Hewitt1-Jun-06 22:10
Stephen Hewitt1-Jun-06 22:10 
GeneralRe: User interface problem -- check a point is inside a polygon or not [modified] Pin
George_George1-Jun-06 22:32
George_George1-Jun-06 22:32 
Questionsorting vector that holds object Pin
voorugonda prashanth1-Jun-06 20:49
voorugonda prashanth1-Jun-06 20:49 
AnswerRe: sorting vector that holds object Pin
Stephen Hewitt1-Jun-06 21:13
Stephen Hewitt1-Jun-06 21:13 
// Console.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;

// My object.
class MyObject
{
public:
MyObject(int Index) : m_Index(Index) {}

int m_Index;
};

// Output to stream.
ostream& operator<<(ostream &s, const MyObject &o)
{
s << o.m_Index;
return s;
}

// A functor to compare two 'MyObject's based on the member 'm_Index'.
struct MyObjectLess
{
bool operator()(const MyObject &l, const MyObject &r) const
{
return l.m_Index < r.m_Index;
}
};

int main(int argc, char* argv[])
{
// Our collection.
vector<MyObject> objects;

// Fill the collection.
objects.push_back(MyObject(3));
objects.push_back(MyObject(1));
objects.push_back(MyObject(4));
objects.push_back(MyObject(1));
objects.push_back(MyObject(5));
objects.push_back(MyObject(9));

// Print the collection.
cout << "Before sorting:" << endl;
copy(objects.begin(), objects.end(), ostream_iterator<MyObject>(cout, "\n"));
cout << endl;

// Sort them based on the 'm_Index' member variable.
sort(objects.begin(), objects.end(), MyObjectLess());

// Print the collection.
cout << "After sorting:" << endl;
copy(objects.begin(), objects.end(), ostream_iterator<MyObject>(cout, "\n"));
cout << endl;

return 0;
}


Steve
AnswerRe: sorting vector that holds object [modified] Pin
Viorel.1-Jun-06 21:29
Viorel.1-Jun-06 21:29 
AnswerRe: sorting vector that holds object Pin
toxcct1-Jun-06 21:54
toxcct1-Jun-06 21:54 
QuestionHow to draw line graph without using MsExcel Pin
MikeRT1-Jun-06 20:39
MikeRT1-Jun-06 20:39 
AnswerRe: How to draw line graph without using MsExcel Pin
Cedric Moonen1-Jun-06 21:09
Cedric Moonen1-Jun-06 21:09 
QuestionIcon added to system trat but popup menu not disappear if I click somewhere else Pin
zahid_ash1-Jun-06 20:38
zahid_ash1-Jun-06 20:38 
AnswerRe: Icon added to system trat but popup menu not disappear if I click somewhere else Pin
Hamid_RT1-Jun-06 20:47
Hamid_RT1-Jun-06 20:47 
GeneralRe: used the same one but popup menu not disappear if I click on some other window Pin
zahid_ash1-Jun-06 20:54
zahid_ash1-Jun-06 20:54 
AnswerRe: Icon added to system trat but popup menu not disappear if I click somewhere else [modified] Pin
Viorel.1-Jun-06 21:52
Viorel.1-Jun-06 21:52 
Questionprogram executing error Pin
Y_Kaushik1-Jun-06 20:31
Y_Kaushik1-Jun-06 20:31 
AnswerRe: program executing error Pin
_AnsHUMAN_ 1-Jun-06 20:37
_AnsHUMAN_ 1-Jun-06 20:37 
AnswerRe: program executing error Pin
toxcct1-Jun-06 21:50
toxcct1-Jun-06 21:50 
QuestionFFMPEG(Libavcodec DLL)+VC++ Pin
RahulOP1-Jun-06 20:29
RahulOP1-Jun-06 20:29 
AnswerRe: FFMPEG(Libavcodec DLL)+VC++ Pin
Hamid_RT1-Jun-06 20:37
Hamid_RT1-Jun-06 20:37 
GeneralRe: FFMPEG(Libavcodec DLL)+VC++ Pin
RahulOP1-Jun-06 21:08
RahulOP1-Jun-06 21:08 
GeneralRe: FFMPEG(Libavcodec DLL)+VC++ Pin
Hamid_RT1-Jun-06 21:31
Hamid_RT1-Jun-06 21:31 
GeneralRe: FFMPEG(Libavcodec DLL)+VC++ [modified] Pin
RahulOP1-Jun-06 22:43
RahulOP1-Jun-06 22:43 
GeneralRe: FFMPEG(Libavcodec DLL)+VC++ [modified] Pin
Hamid_RT2-Jun-06 1:10
Hamid_RT2-Jun-06 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.