Re: Copying fread behaviour on char array




Giox wrote:
Hello everybody I want to create a routine that mimic the fread
behavior operating on char array.
I wrote

size_t fread_char(void* buf, size_t sz, size_t n, char* string_source)
{

memcpy(buf, string_source, sz*n);
string_source += n*sz;

return n;
}

When I leave the routine the string_source doesn't change its value, it
seems that the operation string_source += n*sz; has not been performed

Hint : Use

size_t fread_char(void* buf, size_t sz, size_t n, char**
string_source)

.



Relevant Pages

  • Copying fread behaviour on char array
    ... Hello everybody I want to create a routine that mimic the fread ... behavior operating on char array. ... When I leave the routine the string_source doesn't change its value, ...
    (comp.lang.c)
  • How do I get the address of (&) an object...
    ... I'm using a routine that I didn't write that reads data into a char array. ... but it obviously won't work in Java. ...
    (comp.lang.java.help)