GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MEMINS(3) C Programmer's Manual MEMINS(3)

memins - insert bytes at beginning of memory block

#include <publib.h>
void *memins(void *tgt, size_t tgtsize, const void *src, size_t srcsize);

memins inserts srcsize bytes from src at the beginning of tgt, but moves the first tgtsize out of the way. The source and target memory blocks must not overlap.

memins returns its first argument.

To insert a new element at the ith position of an array, one might do the following.


int new, array[10]; memins(array+i, (10-i-1)*sizeof(array[0]), &new, sizeof(new));
Please note that the above code carefully avoids the trap of moving the last element of the array past the end of the array.

publib(3), strins(3)

Lars Wirzenius (lars.wirzenius@helsinki.fi)
C Programmer's Manual Publib

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.