Re: [R] Pass String from R to C

From: Jaimin Dave <davejaiminm_at_gmail.com>
Date: Mon, 25 Apr 2011 11:51:32 -0500

I tried using char ** but it is printing some random string.

On Sat, Apr 23, 2011 at 6:08 PM, Duncan Murdoch <murdoch.duncan_at_gmail.com>wrote:

> On 11-04-23 7:04 PM, Jaimin Dave wrote:
>
>> Hi,
>> I am using a function which accepts the string from R and prints it.
>> But when I am calling .C("main","hello");
>> it is printing any random thing.
>> My C function is
>> void main(char *str)
>>
>
> See Writing R Extensions. The declaration should be char **str.
>
> Duncan Murdoch
>
> {
>> Rprintf("%s",str);
>> }
>>
>> Can you help how to achieve this using .C interface?
>>
>> Thanks
>> Jaimin
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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. Received on Mon 25 Apr 2011 - 16:56:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Apr 2011 - 17:20:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive