Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Stream10
//g++ 7.4.0 ////////////////////////////////////////////////////////////////////// //Stream10 //this code is created by Rezaul Hoque on July 28,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ////////////////////////////////////////////////////////////////////////////// #include <iostream> #include <sstream> //stream manipulator std::ostream& l(std::ostream& os) { return (os<<"\n"); } void fill(char c) { std::cout.width(40); std::cout.fill(c); std::cout<<l; } int main() { fill('~'); fill('~'); std::stringbuf b; std::ostream o(&b); b.sputc('J'); o<<"uly "; std::cout<<b.str()<<l; std::stringbuf b1("July 28", std::ios_base::in|std::ios_base::out|std::ios_base::app); std::ostream o2(&b1); b1.sputc(','); b1.pubseekpos(9); b1.sputc('2'); b1.sputc ('0'); b1.sputc ('2'); b1.sputc ('2'); b1.pubseekpos(-1); o2<<"***"; o2.seekp(0,std::ios_base::beg); o2<<"!"; std::cout<<&b1<<l; fill('~'); fill('~'); return 0; }
run
|
edit
|
history
|
help
0
Good morning
Stream3
logcOperator
append
Cley
My Pratice
cppPyProperty
Test 17(2021)
Handling new types without using RTTI
Chinu