std::ohserialstream cout(Serial) print issue

Hi guys,

I was wondering if you can give me a hand with a printing issue i’ve been having with IDE 1.6.7 and Atmel 7 with andy STD lib 1.2, the thing is every time i try to print with ohserialstream it only prints the first two characters. I’ve seen similar post without any solutions (, any idea?. In this case it onle prints “He”.

#include <pnew.cpp>

using namespace std;

namespace std
ohserialstream cout(Serial);

vector strings;

void setup(void)

copy(strings.begin(),strings.end(),ostream_iterator(cout," "));
cout << endl;

void loop(void) { }

That's an incredibly complicated way to avoid using Serial.print(). Good luck.

Hi Paul,

Serial.print() doesnt allow me to print std::string variables.


Serial.print() doesnt allow me to print std::string variables.

A std::string wraps a NULL terminated char array. Surely, there is some method of getting at the string that the std::string wraps, like c_str().

Hey Paul,

Thanks for replying but i could make it work, im kinda a newby but...

It seems that andy's std doesnt work with newer IDE, it was designed i think for 1.0.x. I tested StandardCPlusPlus that someone added some features from andys and works like a charm with IDE 1.6.7

For anyone using recent IDE and needs std vectors or other std libs.