C++/Console/cout pcount — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
|
(нет различий)
|
Текущая версия на 10:27, 25 мая 2010
pcount(): reports that outs contains
#include <strstream>
#include <iostream>
using namespace std;
int main()
{
char str[80];ostrstream outs(str, sizeof(str));
outs << "abcdefg ";
outs << 27 << " " << 890.23;
outs << ends; // null terminate
cout << "chars in outs: "<< outs.pcount(); //
cout << " " << str;
return 0;
}