Tips and Tricks

Consider using std::vector<> for buffers over raw arrays and boost::array

A buffer variable for use with read and write operations could be defined:

  char buffer[max_size];


  boost::array<char, max_size> buffer;


  std::vector<char> buffer(max_size);

Consider using this last form based on std::vector<>, as it allows your application to use buffer debugging.

Edit | Attach | Print version | History: r7 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 28 Jul 2008 - 12:10:11 - ChrisKohlhoff
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback