Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unhandled exception... Pin
SilverShalkin14-May-02 17:04
SilverShalkin14-May-02 17:04 
GeneralRe: Unhandled exception... Pin
Christian Graus14-May-02 17:36
protectorChristian Graus14-May-02 17:36 
GeneralRe: Unhandled exception... Pin
SilverShalkin14-May-02 18:01
SilverShalkin14-May-02 18:01 
GeneralRe: Unhandled exception... Pin
Christian Graus14-May-02 18:47
protectorChristian Graus14-May-02 18:47 
GeneralRe: Unhandled exception... Pin
Renjith Ramachandran14-May-02 18:05
Renjith Ramachandran14-May-02 18:05 
GeneralRe: Unhandled exception... Pin
SilverShalkin15-May-02 3:44
SilverShalkin15-May-02 3:44 
GeneralDrawing Image For The Web Pin
Nick Parker14-May-02 14:29
protectorNick Parker14-May-02 14:29 
GeneralSort algorithm Pin
John Cruz14-May-02 12:45
John Cruz14-May-02 12:45 
Can anyone help me fix this. i am trying to sort the y's of my sprite from highest to lowest values and then print it out. this is what i have but my compiler wont compile it. can anyone kind enough to help me fix this to allow it work. anyways, thank you very very much. i really appreciate it. Big Grin | :-D

#include <iostream>
using namespace std;

struct SPRITE
{
int x;
int y;
};

// Maximum number of sprites
const int N_SPRITES = 10;

// Array of sprites
SPRITE sprites[N_SPRITES];

bool Compare (const SPRITE &one, const SPRITE &two);
/* Pre: Enter a Sprite value for one and two
* Post: Compares all of both strings
*/

int main()
{
int value;
for (int i=0; i<n_sprites; i++)
="" {
="" cout="" <<="" "enter="" a="" value:="" ";
="" cin="">> value;
sprites[i].y = value;
}

int* begin = &sprites[0];
int* end = &sprites[9];
sort(begin, end, Compare);

for (i=0; i
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 12:51
protectorChristian Graus14-May-02 12:51 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 13:00
John Cruz14-May-02 13:00 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 13:02
protectorChristian Graus14-May-02 13:02 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 13:15
John Cruz14-May-02 13:15 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 13:48
protectorChristian Graus14-May-02 13:48 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 14:23
John Cruz14-May-02 14:23 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 15:02
protectorChristian Graus14-May-02 15:02 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 16:32
John Cruz14-May-02 16:32 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 17:44
protectorChristian Graus14-May-02 17:44 
GeneralRe: Sort algorithm Pin
Jon Hulatt15-May-02 0:09
Jon Hulatt15-May-02 0:09 
Generalincreasing maximum threads per process Pin
scott sanders14-May-02 12:21
scott sanders14-May-02 12:21 
GeneralRe: increasing maximum threads per process Pin
Anders Molin14-May-02 12:38
professionalAnders Molin14-May-02 12:38 
GeneralRe: increasing maximum threads per process Pin
Tim Smith14-May-02 12:44
Tim Smith14-May-02 12:44 
GeneralRe: increasing maximum threads per process Pin
Andrew Hafen14-May-02 13:07
Andrew Hafen14-May-02 13:07 
GeneralPredefined control class names Pin
ed987114-May-02 11:30
ed987114-May-02 11:30 
GeneralRe: Predefined control class names Pin
Larry Antram14-May-02 12:00
Larry Antram14-May-02 12:00 
GeneralShowing a larger image in a small PictureBox Pin
14-May-02 11:05
suss14-May-02 11:05 

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.