Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: (Hopefully) Quick and Easy C++ Question  (Read 2039 times)

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: (Hopefully) Quick and Easy C++ Question
« Reply #15 on: June 22, 2011, 03:59:00 pm »

You can use _scprintf to count the amount of buffer you need, allocate it, then use sprintf.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

McTraveller

  • Bay Watcher
  • This text isn't very personal.
    • View Profile
Re: (Hopefully) Quick and Easy C++ Question
« Reply #16 on: June 24, 2011, 08:30:04 pm »

Because sprintf is very vulnerable to buffer overruns.
There is this function called snprintf to address that very issue.

Logged
This product contains deoxyribonucleic acid which is known to the State of California to cause cancer, reproductive harm, and other health issues.
Pages: 1 [2]