PDA

View Full Version : c++ help



zerobinary
June 25th, 2007, 02:01 AM
i dont get what is manipulator

ios_base
June 25th, 2007, 06:05 AM
Why are you asking what a manipulator is? Can you be more specific?

hod139
June 25th, 2007, 01:59 PM
Are you asking about IO manipulation?
http://www.cppreference.com/io_flags.html#format_flags
http://www.cprogramming.com/tutorial/iomanip.html

Golyadkin
June 25th, 2007, 02:36 PM
Do you maybe want to overload the C++ manipulator functions?

zerobinary
June 25th, 2007, 07:44 PM
but the book accelrated c++ page 4 say statement std::cout<<"helloworld"<<std::endl
and std::endl is manipulator just wonder what is it
plz help
that's all i know
since i am newbie i don't know how to be more specific

Mis_Uszatek
June 25th, 2007, 07:59 PM
Manipulator in your context...

it is just a 'thing' which manipulates stream(std::cout in your example).
There are more of these manipulators, e.g. you are able to set big letter for example
(it is a pseudocode, I do not remember what is a value)


std::cout << std::big_letters << "hello" << std::endl;

result is:


HELLO\n


hod139 gave you a link

http://www.cprogramming.com/tutorial/iomanip.html

There is a good explanation.

zerobinary
June 26th, 2007, 05:14 AM
errr is there a easier definition for it
is it basically control ???

plz help me i mean i still don't quite get it

skullmunky
June 26th, 2007, 10:40 AM
i guess you could call it control, or a better description would be "filtering". the manipulators in the examples in that link below are better examples - they "manipulate" or "filter" the text you're printing by formating it in different ways, changing to upper case or lower case, controlling how many decimal places get printed, etc.

std::endl is "end line" - a newline or carriage return. it doesn't really do any manipulation or filtering, but it's included in the "manipulators" category anyway.

zerobinary
June 26th, 2007, 09:21 PM
thx now i have some idea about it