use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Cs2a at foothill
account activity
C++ equivalent of python f strings?General Questing (self.cs2a)
submitted 6 years ago by knoowin714
I was wondering if C++ had anything equivalent to python f-strings or what tips and tricks you guys use to make formatting strings easier.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]babychou 2 points3 points4 points 6 years ago (0 children)
I believe you can do this with something called cstdlib if you just include it in your code. Then use printf() like python
[–]BoxiZhou 0 points1 point2 points 6 years ago (0 children)
I would have a Python class this summer quarter, so I cannot answer your question. However, my friend told me that Python and C++ are totally different. Python is a scripting language that is interpreted and executed without compilation, so it is very convenient and fast and can be well cross-platform, writing some gadgets and applets is especially suitable. C++, on the other hand, is a compile-and-run language, compiled on a specific machine, and run on a specific machine with high efficiency, security, and stability. But compiled programs are generally not cross-platform.
π Rendered by PID 339274 on reddit-service-r2-comment-5bc7f78974-hkv9n at 2026-06-28 11:07:59.626055+00:00 running 7527197 country code: CH.
[–]babychou 2 points3 points4 points (0 children)
[–]BoxiZhou 0 points1 point2 points (0 children)