User forums > Help

How do I incorporate '\n' into an abbreviation?

(1/2) > >>

SimbaSpirit:
I'm trying to make this abbreviation
cini (ctrl+j) = cin.ignore( numeric_limits <streamsize> ::max(), '\n' );

However, whenever I save my work, shut down the program, then reopen it I get
cini (ctrl+j) =
cin.ignore( numeric_limits <streamsize> ::max(), '
' );


How do I get C::B to actually insert the \n instead of evaluating it?

MortenMacFly:

--- Quote from: SimbaSpirit on October 19, 2008, 05:52:21 pm ---cini (ctrl+j) = cin.ignore( numeric_limits <streamsize> ::max(), '\n' );

--- End quote ---
I guess you already tried escaping - alias '\\n'???

SimbaSpirit:
Yeah I should have made another post saying I already tried that.

cin.ignore( numeric_limits <streamsize> ::max(), '\\n' );

becomes

cin.ignore( numeric_limits <streamsize> ::max(), '\
' );

At the moment I have replaced the n with a pipe, but this workaround would be a real pain in a larger template

SimbaSpirit:
Has anyone else made this work before?
Any other ideas?

SimbaSpirit:
Bump

Navigation

[0] Message Index

[#] Next page

Go to full version