You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using std::cout;
int w = cout.width(30);
cout << "default field width = " << w << ":\n";
cout.width(5);
cout << "N" <<':';
cout.width(8);
cout << "N * N" << ":\n";
for (long i = 1; i <= 100; i *= 10)
{
cout.width(5);
cout << i <<':';
cout.width(8);
cout << i * i << ":\n";
}
// std::cin.get();
}[/code]
void loop() {}
is supposed to print right justified. It doesn't, everything on a line is jammed together.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
This is most likely because the baud rate of the serial port you set is too high. It had no problem setting the 9600 baud rate, while setting it to a value as high as yours it will become garbled.
This code:
[code]
// width.cpp -- using the width method
// C++ primer 17.4, page 1080
#include <ArduinoSTL.h>
//#include <PrintStream.h>
void setup() {
Serial.begin(115200);
}[/code]
void loop() {}
is supposed to print right justified. It doesn't, everything on a line is jammed together.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: