Displaying 1 result from an estimated 1 matches for "uuuggly".
2005 Feb 03
1
filling a string buffer in a C routine
...filename),
buf=buffer,
buflen=as.integer(10))$buf
--- end code ---
This works okay, but the only way I could find to allocate a string
buffer of the size I want is to use a string literal as in the line
marked "kludge" above. It is impractical for large buffers, not to
mention uuuggly. I tried
buffer = paste(rep('x', 10), sep="")
but it doesn't work. So my question is, how do I do one of the following:
- Allocate a character buffer of a desired size to pass to my C routine.
- Have the C routine allocate the buffer without causing a memory leak.
- Use .C...