How to create print function like python in c ++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to create print function like python in c ++?

I create a simple print function of common types just for testing but I'm still not sure how the program works, but I want to create a print function to make my life easier. But I know at most I can create one that only displays strings or integer values, characters, etc. but how to create a print function that shows all types of variables, and also strings? I have to create a lib? Please explain to me.

22nd Mar 2018, 11:30 PM
Alexandre Kawan
Alexandre Kawan - avatar
3 Answers
22nd Mar 2018, 11:35 PM
Dread
Dread - avatar
+ 5
Here's a discussion and external lib, just for reading about an expansion on printf() and some challenges: https://blog.galowicz.de/2016/11/05/python_style_printf_for_cpp/
23rd Mar 2018, 5:30 AM
Kirk Schafer
Kirk Schafer - avatar
23rd Mar 2018, 12:32 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar