Regarding reading signed integer using wxDataInputStream

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
saranya
Earned a small fee
Earned a small fee
Posts: 13
Joined: Mon May 23, 2016 9:47 am

Regarding reading signed integer using wxDataInputStream

Post by saranya » Fri Aug 30, 2019 12:17 pm

we are reading a file using wxDataInputStream we are having signed integer values in the data. As Read32 or Read64 are returning unsigned integer.How to get signed integer value.

Manolo
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 695
Joined: Mon Apr 30, 2012 11:07 pm

Re: Regarding reading signed integer using wxDataInputStream

Post by Manolo » Fri Aug 30, 2019 3:38 pm

Some types use the overloaded "<<" operator:

Code: Select all

wxFileInputStream input( "mytext.dat" );
wxDataInputStream store( input );
wxInt32 ivar;
store >> ivar; // reads a signed integer
You can find these overloads at yourwxdir/include/wx/datstrm.h

Post Reply