stringstream and dll

B

blackstreetcat

I'm trying to send a stringstream to a function in a dll like so:

in Dll:
class A
{int i;
f(istream& in)
{
in>>i;
}
};


in the exe:
A a;
stringstream s<<1;
a.f(s);

the code dosent work access violation;
using standard std::cin works fine;

what is the problem with sringstream and how can \i fix it?
thanks.
Kat.
 
R

Rolf Magnus

I'm trying to send a stringstream to a function in a dll like so:

in Dll:
class A
{int i;
f(istream& in)
{
in>>i;
}
};

This class has only private members. It's not a very useful one.
in the exe:
A a;
stringstream s<<1;

This should generate a compile error.

This too.
the code dosent work access violation;
using standard std::cin works fine;

what is the problem with sringstream and how can \i fix it?

Questions about "dll" are best asked in a Microsoft specific newsgroup. ISO
C++, which is the topic of this newsgroup, doesn't say anything about it.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top