Using std::cout in V 3.0.0 for MODM7AE70
Posted: Mon Jan 21, 2019 5:29 am
std::cout does not do a carriage return (\r) for output in MTTTY on my Windows 10 machine.
Previous versions always did.
For the code:
I get this in the MTTTY window:
It std::endl seems to work fine from within a std::stream, for example, the code:
gives this output:
I think std::endl should be consistent between std::streams and std::cout. That would save me having to put a "\r" into every std::cout statement.
Ed
Previous versions always did.
For the code:
Code: Select all
while (1) {
OSTimeDly(TICKS_PER_SECOND);
std::cout << "one "<<endl << "two "<< endl ;
}
}
Code: Select all
one
two
one
two
one
two
one
two
one
two
Code: Select all
std::ostringstream Reading;
Reading <<"one "<<std::endl << "two "<< std::endl ;
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
std::cout << Reading.str() <<"three "<< std::endl ;
}
}
Code: Select all
one
two
three
one
two
three
one
two
three
Ed