Your C ++ project may well use standard input and output.
The problem, as described in the Writing R-Extensions guide, is that you end up mixing two output systems: R and C ++.
So, you are "recommended" to replace all uses, say
std::cout << "The value of foo is " << foo << std::endl;
with something like
Rprintf("The value of foo is %f\n", foo);
so that your result mixes correctly with R. In one of my (non-Rcpp) packages I had to make many tedious corrections for this ...
Now, as mentioned in the @vasicbre comment and @Dason's answer, if you use Rcpp, you can just do
Rcpp::Rout << "The value of foo is " << foo << std::endl;
If you are already using Rcpp, this is pretty simple, otherwise you need to decide whether to add Rcpp ...
source share