c++ - What is the most performant way to write a string to a file? -


i have code runs lots of loops updating single string. want string stored in file.

currently printing string console. can use ofstream , write file instead of console.

  • instead using string updated, use directly file stream
  • use string stream instead , copy string stream file stream , write file.
  • after update of string complete should write file stream @ once.

the std::string::max_size in compiler : 4294967257 , the maximum size of string generate approximately half of max_size of compiler.

note: using solaris unix.

what performant way write string file?

there's 1 way know answer. have profile case. can measuring timings how long takes generate file.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -