Hi
I have an multiline edit control, that the user can type anything.
Mi problem es I need to save that text in a single line:
To be:Code:"Hello World"
Any ideas about how to parse the text in C?Code:"Hello\nWorld"
This is a discussion on How to print "\n" or "\t" within the C Programming forums, part of the General Programming Boards category; Hi I have an multiline edit control, that the user can type anything. Mi problem es I need to save ...
Hi
I have an multiline edit control, that the user can type anything.
Mi problem es I need to save that text in a single line:
To be:Code:"Hello World"
Any ideas about how to parse the text in C?Code:"Hello\nWorld"
* Debian 6.0.1 on Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM.
* lighttpd, php5, perl, eruby, python.
* geany, XHTML & CSS & JavaScript, C, C++.
* GTK+ C & perl-gtk2
Every time there is an instance of a '\n' character in the string replace it with the pair of characters '\\' (two backslashes needed in C code to get one backslash in output) and 'n'. Similar technique for '\t'.