KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a format string like this: buf[] = "A%d,B%d,C%d,D%d,F%d,G%d,H%d,I%d,J%d"; and I want to insert the same integer for each %d so I use: int val = 6; sprintf(buf2, buf, val,val,val,val,val,val,val,val,val); Can I use sprintf in a way that only requires me to write val once, and sprintf will use it for each %d ?
Tags (comma-separated)
Save Edits
Cancel