C++

std::format & std::print

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

std::format (C++20) e ndërton tekstin si f-strings e Python-it: std::format("{} ka notën {}", emri, nota). std::print (C++23) e shfaq direkt. Shumë më i lexueshëm se << me iomanip.

EnglishEN

std::format (C++20) builds text like Python's f-strings: std::format("{} has grade {}", name, grade). std::print (C++23) prints it directly. Much more readable than << with iomanip.

Si ta mendosh

Si ftesa me vende bosh që plotësohen me emrat.

Lexoje në anglisht

Like an invitation with blanks filled in with names.

Shembull kodicpp

#include <format>
std::string s = std::format("{} ka notën {:.1f}", "Arta", 4.75);
std::print("{:>8}|\n", "djathtas");

Terma të lidhur