Copying fread behaviour on char array
- From: "Giox" <giovanniparodi79@xxxxxxxx>
- Date: 31 Mar 2006 05:53:58 -0800
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
.
- Follow-Ups:
- Re: Copying fread behaviour on char array
- From: Kenneth Brody
- Re: Copying fread behaviour on char array
- From: Ivanna Pee
- Re: Copying fread behaviour on char array
- Prev by Date: Re: passing a pointer to a struct to a function that uses ncurses
- Next by Date: Re: passing a pointer to a struct to a function that uses ncurses
- Previous by thread: passing a pointer to a struct to a function that uses ncurses
- Next by thread: Re: Copying fread behaviour on char array
- Index(es):
Relevant Pages
|