Cairo Printing
Overview
Guide printing for standard and custom types, including Display and Debug formatting.
Quick Use
- •Read
references/printing.mdbefore answering. - •Use
println!for newline output andformat!for ByteArray formatting. - •Recommend
Debugfor complex types when no Display impl exists.
Response Checklist
- •
println!andprint!use Display ({}) and Debug ({:?}). - •
format!returns a ByteArray and does not consume inputs. - •For custom types, implement
Displayor deriveDebug. - •Use
write!/writeln!withFormatterfor custom formatting.
Example Requests
- •"How do I print a struct in Cairo?"
- •"What is the difference between Display and Debug?"
- •"How do I format a string without printing?"