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

C / C++ / MFC

 
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.

GeneralRe: Stripping new line problem Pin
csrss21-Feb-11 23:32
csrss21-Feb-11 23:32 
AnswerRe: Stripping new line problem Pin
Niklas L21-Feb-11 20:05
Niklas L21-Feb-11 20:05 
GeneralRe: Stripping new line problem Pin
csrss21-Feb-11 23:42
csrss21-Feb-11 23:42 
QuestionHow to capture the desktop image behind my main window Pin
Tcpip200521-Feb-11 1:28
Tcpip200521-Feb-11 1:28 
AnswerRe: How to capture the desktop image behind my main window Pin
Hans Dietrich21-Feb-11 1:38
mentorHans Dietrich21-Feb-11 1:38 
GeneralRe: How to capture the desktop image behind my main window Pin
Tcpip200521-Feb-11 14:20
Tcpip200521-Feb-11 14:20 
AnswerRe: How to capture the desktop image behind my main window Pin
_AnsHUMAN_ 21-Feb-11 1:44
_AnsHUMAN_ 21-Feb-11 1:44 
AnswerRe: How to capture the desktop image behind my main window Pin
goorley24-Feb-11 21:03
goorley24-Feb-11 21:03 
QuestionWM_COMMAND is not getiing fired Pin
VC_RYK20-Feb-11 23:38
VC_RYK20-Feb-11 23:38 
AnswerRe: WM_COMMAND is not getiing fired Pin
Andrew Brock20-Feb-11 23:57
Andrew Brock20-Feb-11 23:57 
QuestionMessageBox vs AfxMessageBox Pin
Jens Joseph20-Feb-11 23:13
Jens Joseph20-Feb-11 23:13 
AnswerRe: MessageBox vs AfxMessageBox Pin
_AnsHUMAN_ 20-Feb-11 23:50
_AnsHUMAN_ 20-Feb-11 23:50 
AnswerRe: MessageBox vs AfxMessageBox Pin
Hans Dietrich20-Feb-11 23:59
mentorHans Dietrich20-Feb-11 23:59 
GeneralRe: MessageBox vs AfxMessageBox Pin
Jens Joseph21-Feb-11 0:05
Jens Joseph21-Feb-11 0:05 
GeneralRe: MessageBox vs AfxMessageBox Pin
Hans Dietrich21-Feb-11 0:28
mentorHans Dietrich21-Feb-11 0:28 
AnswerRe: MessageBox vs AfxMessageBox Pin
Andrew Brock21-Feb-11 0:30
Andrew Brock21-Feb-11 0:30 
Questionhow to use arguments Control in another class Pin
so0_lanhlung220-Feb-11 23:09
so0_lanhlung220-Feb-11 23:09 

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.