Dear R users,

I am trying to include C code into R via the .C interface.  I have read
that arguments passed to a C function have to be correctly DEreferenced.
This is something that can be easily done for numbers (integers or float) by adding
a * before the reference like for instance:

------------------------------------------------------------------------
#include<R.h>


void hellofct(int *n)
   {
       int i;
       for (i=0;i<*n;i++)
           {
               Rprintf("Hello, world!\n");
           }
   }
------------------------------------------------------------------------
However, I can not figure out how that can be achieved for strings.
My prototype function would be something like:

------------------------------------------------------------------------
#include<R.h>


void displaystring(char *str)
   {
       Rprintf("String displayed:%s\n", ????);
   }
------------------------------------------------------------------------
any hints?

Thx.

Stéphane.

--
==========================================================
Stephane CRUVEILLER Ph. D.
Genoscope - Centre National de Sequencage
Atelier de Genomique Comparative
2, Rue Gaston Cremieux   CP 5706
91057 Evry Cedex - France
Phone: +33 (0)1 60 87 84 58
Fax: +33 (0)1 60 87 25 14
EMails: [EMAIL PROTECTED] ,[EMAIL PROTECTED]
===========================================================

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to