N
newbarker
Hello all,
#include <sstream>
#include <iostream>
int main()
{
std::istringstream iss("6.5e");
double size;
char fit;
iss >> size >> fit;
std::cout << "size(" << size << "), fit(" << fit << ")" << std::endl;
}
This program doesn't extract the elements okay (apparent garbage
output) but if the input stream is 6.5d it does. I figure this is
because the extraction operator thinks it's going to have a number
like 6.5e+12??? Is there a way I can turn this feature off and make it
extract 6.5 and d separately?
Regards,
Pete
#include <sstream>
#include <iostream>
int main()
{
std::istringstream iss("6.5e");
double size;
char fit;
iss >> size >> fit;
std::cout << "size(" << size << "), fit(" << fit << ")" << std::endl;
}
This program doesn't extract the elements okay (apparent garbage
output) but if the input stream is 6.5d it does. I figure this is
because the extraction operator thinks it's going to have a number
like 6.5e+12??? Is there a way I can turn this feature off and make it
extract 6.5 and d separately?
Regards,
Pete