Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,233 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,763 people online right now. Registration is fast and FREE... Join Now!




What type is endl?

 
Reply to this topicStart new topic

What type is endl?

okyup
13 Mar, 2007 - 02:30 PM
Post #1

D.I.C Head
Group Icon

Joined: 6 Nov, 2006
Posts: 207


Dream Kudos: 175
My Contributions
I want to catch it in >> insertion operator overload.

Like this:
CODE
obj& operator << (std::string& s);


But I don't know how to catch an endl.

I actually read it somewhere last week but I can't remember. sad.gif

Anyone know?
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: What Type Is Endl?
13 Mar, 2007 - 03:04 PM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,230



Thanked: 40 times
Dream Kudos: 25
My Contributions
endl is not a data type, it is a manipulator. It forces a line break and flushes the stream.

Are you trying to catch the newline? (\n)
User is online!Profile CardPM
+Quote Post

okyup
RE: What Type Is Endl?
13 Mar, 2007 - 03:06 PM
Post #3

D.I.C Head
Group Icon

Joined: 6 Nov, 2006
Posts: 207


Dream Kudos: 175
My Contributions
Found it actually.

Getting to love google codesearch. smile.gif

CODE
obj& operator<<(ostream& (*pf)(ostream&));

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 03:44PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month