Bug in VC++ .NET 2003, stringstream and tellp

E

Edward Diener

If you run this simple console program after building it on VC++ .NET 2003,
you will see the error message, "Error getting initial stream position",
from the attempt to use the std::blush:stream::tellp() method to get the output
stream position of a std::stringstream. I can see no reason for this error
and deem it a bug in VC++ .NET 2003. If anyone knows of a workaround or a
fix for this, I would appreciate finding out about it. BTW, where do I
officially report a bug in VC++ .NET 2003 to Microsoft ?

#include "stdafx.h"
#include <sstream>
int _tmain(int argc, _TCHAR* argv[])
{
std::stringstream stream;
std::stringstream::pos_type begpos;
stream.flush();
if (!stream)
{
std::cout << "\r\nError flushing stream\r\n";
}
begpos = stream.tellp();
if (begpos == std::stringstream::pos_type(-1))
{
std::cout << "\r\nError getting initial stream position\r\n";
}
char buffer[256];
std::cout << "\r\nPress any character and hit enter to end program\r\n";
std::cin.getline(buffer,256);
return 0;
}
 
C

Carl Daniel [VC++ MVP]

Here is generally fine for reporting VC++ bugs.

I've added microsoft.public.vc.stl & set follow-ups to that group as well -
the Dinkumware guys are frequently seen there.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top