Escape sequence \f - form feed - what exactly is it?

\f is said to be the form feed. \t is a tab, \a is a beep, \n is a newline. What exactly is a form feed - \f? The following program

#include <iostream>
int main()
{
   std::cout << "hello\fgoodbye" << std::endl;  
}

prints hello then a female sign (an upside down holy hand grenade:) and then goodbye all on one line.

Answers


It skips to the start of the next page. (Applies mostly to terminals where the output device is a printer rather than a VDU.)


From wiki page

12 (form feed, \f, ^L), to cause a printer to eject paper to the top of the next page, or a video terminal to clear the screen.

or more details here.

It seems that this symbol is rather obsolete now and the way it is processed may be(?) implementation dependent. At least for me your code gives the following output (xcode gcc 4.2, gdb console):

hello
    goodbye

Need Your Help

PreparedStatement.addBatch in java has any restrictions?

java sql mysql jdbc

I'm trying to optimize the process of inserting a large number of results to a remote mySQL database. I'm using simple jdbc for that.

Concatenating data in different columns into a single column (pandas, python)

python excel pandas

I am looking for the logic to concatenate the values in many columns with related data from an .xlsx file into a single column using pandas in python. The logic to combine each different column wou...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.