Click here to Skip to main content
15,884,353 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: help with array in C Pin
«_Superman_»14-Apr-10 9:42
professional«_Superman_»14-Apr-10 9:42 
QuestionRe: help with array in C Pin
CPallini14-Apr-10 9:54
mveCPallini14-Apr-10 9:54 
AnswerRe: help with array in C Pin
Luc Pattyn14-Apr-10 10:30
sitebuilderLuc Pattyn14-Apr-10 10:30 
GeneralRe: help with array in C Pin
CPallini14-Apr-10 10:40
mveCPallini14-Apr-10 10:40 
GeneralRe: help with array in C Pin
Luc Pattyn14-Apr-10 10:42
sitebuilderLuc Pattyn14-Apr-10 10:42 
GeneralRe: help with array in C Pin
CPallini14-Apr-10 11:06
mveCPallini14-Apr-10 11:06 
AnswerRe: help with array in C Pin
ThatsAlok14-Apr-10 18:20
ThatsAlok14-Apr-10 18:20 
AnswerRe: help with array in C Pin
Stuart Dootson14-Apr-10 21:55
professionalStuart Dootson14-Apr-10 21:55 
So you want to find the longest sub-sequence where the numbers are in ascending order?

I would loop through the array from item 1 to the last item, checking if the current item is larger than the previous item. You need to maintain the current ordered sequence length, which you would reset if you detect an item that's smaller than the previous one, and increment if the current item is bigger than the previous one. You also need to record the maximum ordered sequence length, which you would set to the current ordered sequence length when the current one is bigger than the maximum.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

CodeProject MVP for 2010 - who'd'a thunk it!

AnswerRe: help with array in C Pin
Farraj15-Apr-10 14:26
Farraj15-Apr-10 14:26 
QuestionInline Assembly with Visual C++ 2008 Pin
aurelcly14-Apr-10 8:55
aurelcly14-Apr-10 8:55 
AnswerRe: Inline Assembly with Visual C++ 2008 Pin
Luc Pattyn14-Apr-10 9:31
sitebuilderLuc Pattyn14-Apr-10 9:31 
AnswerRe: Inline Assembly with Visual C++ 2008 Pin
Michel Godfroid14-Apr-10 12:11
Michel Godfroid14-Apr-10 12:11 
QuestionWhitebox Testing Pin
Super Hornet14-Apr-10 6:08
Super Hornet14-Apr-10 6:08 
AnswerRe: Whitebox Testing Pin
«_Superman_»14-Apr-10 8:04
professional«_Superman_»14-Apr-10 8:04 
GeneralRe: Whitebox Testing Pin
Super Hornet22-Apr-10 3:39
Super Hornet22-Apr-10 3:39 
QuestionRe: Whitebox Testing Pin
CPallini14-Apr-10 9:00
mveCPallini14-Apr-10 9:00 
AnswerRe: Whitebox Testing Pin
Super Hornet22-Apr-10 3:35
Super Hornet22-Apr-10 3:35 
AnswerRe: Whitebox Testing Pin
ThatsAlok14-Apr-10 18:22
ThatsAlok14-Apr-10 18:22 
GeneralRe: Whitebox Testing Pin
Super Hornet22-Apr-10 3:38
Super Hornet22-Apr-10 3:38 
QuestionWorker thread Pin
msr_codeproject14-Apr-10 3:18
msr_codeproject14-Apr-10 3:18 
QuestionRe: Worker thread Pin
CPallini14-Apr-10 3:24
mveCPallini14-Apr-10 3:24 
AnswerRe: Worker thread Pin
msr_codeproject14-Apr-10 3:30
msr_codeproject14-Apr-10 3:30 
GeneralRe: Worker thread Pin
Cedric Moonen14-Apr-10 4:16
Cedric Moonen14-Apr-10 4:16 
GeneralRe: Worker thread Pin
Maximilien14-Apr-10 4:44
Maximilien14-Apr-10 4:44 
GeneralRe: Worker thread Pin
CPallini14-Apr-10 5:15
mveCPallini14-Apr-10 5:15 

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.