Notepad++ escape characters
#6

There's nothing wrong with the if statement - he is simply escaping the ' character to avoid problems with the compiler detecting it as the end of the string.

if(inputtext[i] == '\'')
... is a perfectly valid check.

By the way, your loop could use some improving instead. Your current code will call strlen() n times where n = strlen(string). This can be reduced to 1 only. The longer your string gets, the more time these strlen() calls will consume.

// Edit: try out inputtext[i] == 27 for the sake of it
Reply


Messages In This Thread
Notepad++ escape characters - by cosbraa - 02.03.2013, 08:01
Re: Notepad++ escape characters - by Scenario - 02.03.2013, 08:14
Re: Notepad++ escape characters - by cosbraa - 02.03.2013, 08:22
Re: Notepad++ escape characters - by cessil - 02.03.2013, 08:30
Re: Notepad++ escape characters - by cosbraa - 02.03.2013, 08:33
Re: Notepad++ escape characters - by AndreT - 02.03.2013, 08:34
Re: Notepad++ escape characters - by cosbraa - 02.03.2013, 08:36
Re: Notepad++ escape characters - by cessil - 02.03.2013, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)