Click here to Skip to main content
15,908,254 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: File move and compare in VC++ 6 MFC dialog based program? Pin
ajj10023-Feb-11 9:27
ajj10023-Feb-11 9:27 
AnswerRe: File move and compare in VC++ 6 MFC dialog based program? Pin
David Crow23-Feb-11 9:30
David Crow23-Feb-11 9:30 
AnswerRe: File move and compare in VC++ 6 MFC dialog based program? Pin
ajj10023-Feb-11 9:31
ajj10023-Feb-11 9:31 
QuestionRe: File move and compare in VC++ 6 MFC dialog based program? Pin
ajj10025-Feb-11 5:59
ajj10025-Feb-11 5:59 
AnswerRe: File move and compare in VC++ 6 MFC dialog based program? Pin
David Crow25-Feb-11 6:20
David Crow25-Feb-11 6:20 
AnswerRe: File move and compare in VC++ 6 MFC dialog based program? Pin
Maximilien22-Feb-11 13:54
Maximilien22-Feb-11 13:54 
Questiontemplates & friends Pin
Joerg Koenig22-Feb-11 3:12
Joerg Koenig22-Feb-11 3:12 
AnswerRe: templates & friends Pin
Michael Dunn22-Feb-11 5:47
sitebuilderMichael Dunn22-Feb-11 5:47 
AnswerRe: templates & friends Pin
CPallini22-Feb-11 9:49
mveCPallini22-Feb-11 9:49 
GeneralRe: templates & friends Pin
Rajesh R Subramanian22-Feb-11 19:51
professionalRajesh R Subramanian22-Feb-11 19:51 
GeneralRe: templates & friends Pin
Joerg Koenig22-Feb-11 21:45
Joerg Koenig22-Feb-11 21:45 
Questionwindowless shockwaveflash control doesn't work properly individually Pin
followait21-Feb-11 22:01
followait21-Feb-11 22:01 
AnswerRe: windowless shockwaveflash control doesn't work properly individually Pin
Ahmed Charfeddine22-Feb-11 0:24
Ahmed Charfeddine22-Feb-11 0:24 
GeneralRe: windowless shockwaveflash control doesn't work properly individually Pin
followait22-Feb-11 14:20
followait22-Feb-11 14:20 
QuestionProblem in Excel Automation. Pin
Le@rner21-Feb-11 21:41
Le@rner21-Feb-11 21:41 
AnswerRe: Problem in Excel Automation. Pin
Niklas L21-Feb-11 22:18
Niklas L21-Feb-11 22:18 
QuestionRichEdit and ITextHost scrollbar Pin
Tangwang21-Feb-11 17:26
Tangwang21-Feb-11 17:26 
QuestionGetting File Path of the Current Program [modified] [SOLVED] Pin
AmbiguousName21-Feb-11 7:09
AmbiguousName21-Feb-11 7:09 
AnswerRe: Getting File Path of the Current Program Pin
Hans Dietrich21-Feb-11 7:19
mentorHans Dietrich21-Feb-11 7:19 
AnswerRe: Getting File Path of the Current Program [modified] [SOLVED] Pin
David Crow21-Feb-11 11:05
David Crow21-Feb-11 11:05 
QuestionStripping new line problem Pin
csrss21-Feb-11 4:26
csrss21-Feb-11 4:26 
AnswerRe: Stripping new line problem Pin
Maximilien21-Feb-11 4:48
Maximilien21-Feb-11 4:48 
GeneralRe: Stripping new line problem Pin
csrss21-Feb-11 4:53
csrss21-Feb-11 4:53 
AnswerRe: Stripping new line problem Pin
csrss21-Feb-11 6:17
csrss21-Feb-11 6:17 
AnswerRe: Stripping new line problem Pin
User 742933821-Feb-11 19:48
professionalUser 742933821-Feb-11 19:48 
I'd expect a compiler error on the original code; single quotes mean a character is between them and \r\n is two characters.
If you still want to check for \r\n rather than for any occurence of \r separately, you could use something like this:

for (int i = 0; i < len; i++)
{
    if(!(buff[i] == '\n' || (buff[i] == '\r' && i+1 < len && buff[i+1] == '\n')))
    {
        temp[x] = buff[i];
        x++;
    }
}


modified 13-Sep-18 21:01pm.

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.