Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bcopy.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bcopy.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bcopy.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bcopy.html on line 8
Copy a number of characters in one string to another
#include <strings.h>
void bcopy( const void *src,
void *dst,
size_t n );
- src
- The string you want to copy.
- dst
- An existing array into which you want to copy the string.
- n
- The number of bytes to copy.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The bcopy() function copies the byte string pointed to by
src (including any NUL characters) into the
array pointed to by
dst. The number of bytes to copy is specified by
n. Copying of overlapping objects is guaranteed to work
properly.
|
This function is similar to the ANSI
memmove()
function, but the order of arguments is different.
New code should use the ANSI function. |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main( void )
{
auto char buffer[80];
bcopy( "Hello ", buffer, 6 );
bcopy( "world", &buffer[6], 6 );
printf( "%s\n", buffer );
return EXIT_SUCCESS;
}
produces the output:
Hello world
POSIX 1003.1 XSI
Safety: | |
Cancellation point |
No |
Interrupt handler |
Yes |
Signal handler |
Yes |
Thread |
Yes |
bcmp(),
bzero(),
memmove(),
strcpy()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bcopy.html on line 158
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bcopy.html on line 158