LearnFrenzy
Sign in Take a free test

Input/Output with cin and cout · Input/Output MCQ · Question 19

How to print a literal { with std::format Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 19 Back to Exercise

How do you produce a literal { character with std::format?

  • A \{
  • B {{ Correct
  • C {'{'}
  • D It is impossible
Correct Answer: Option B

Braces are doubled: std::format("{{{}}}", 5) produces {5}.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links