Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
1 answer
241 views

According to cppreference documentation, std::memmove and std::memcpy would expect an object address as input, which will theoretically limit there usage with buffer obtained from C-like API (mmap, ...
6 votes
1 answer
183 views

I have this kind of structure in my code: struct data { volatile int a; volatile int b; }; // Some hardware that require specific access static data *hardware_data = 0x100000; void function(...
DeadMaX's user avatar
  • 73
7 votes
2 answers
397 views

TL;DR: memmove that uses rep movsb is magnitudes slow on overlapping array of 8193 bytes compared to memmove for 8191 elements that doesn't use rep movsb. I'm asking why. Consider the following ...
1 vote
1 answer
75 views

Memmove allows the source and destination to have an overlapping region. And if you're using it with trivially copyable types, the objects copied by memmove will be implicitly created and their ...
6 votes
1 answer
235 views

This code is an attempt to reinterpret memory contents as a different type without violating strict aliasing rules. It was suggested as an answer to "Using std::memmove to work around strict ...
1 vote
2 answers
125 views

I'm sorry if my code is garbage but I wanted to experiment with string manipulation on an already dynamically allocated string without losing my original pointer so that when I do go ahead and free up ...
1 vote
1 answer
152 views

I was writing a program where I had to copy two overlapping strings one into another. After looking around, memmove seemed like what I needed for the task. However, it doesn't seem to be working the ...
1 vote
0 answers
383 views

I recently encountered a performance problem that I can't easily explain. I hope that someone here can help me understand why these two pieces of code perform so differently. (Code snippets in this ...
1 vote
2 answers
353 views

I am attempting to create a function with a similar work to memmove. I found in the man that the copying is done by including a transitionnal array to where bytes are copied first , which should not ...
Sami Walid's user avatar
2 votes
1 answer
212 views

Imagine that I am implementing inserting and deleting within a small vector. (If this is C++ then assume further that the vector elements are trivially copyable.) When inserting into the middle of ...
John Yates's user avatar
  • 1,057
-1 votes
2 answers
117 views

I allocated a space of memory with malloc (to have a matrix) and I have to move the "row" at the end, I tried this: double **dataset = fill_dataset(....); double* temp = malloc((d + 1) * ...
0 votes
1 answer
218 views

Does memmove work on file pointer data? I am trying to remove a line from a C file. I am trying to use memmove to make this more efficient than the internet's recommendation to create a duplicate file ...
0 votes
1 answer
171 views

Assuming I have this array of string char* arr[] = {"Me", "you", "Now", NULL}; My aim is to remove "Me" so that the resultant array is: arr = {"you", ...
0 votes
1 answer
73 views

I'm trying to write memmove in assembly: the problem is that in my section data I've got two line : source and destination, and when I'm trying to pass 20 byte from source to destination while source ...
0 votes
1 answer
232 views

I am working with sending data to and from a client/server application. I have created my own header scheme. This is the flow I am in question about: char *data = returnmydata(); int one = 1; int two =...

15 30 50 per page
1
2 3 4 5
...
11

AltStyle によって変換されたページ (->オリジナル) /