473,883 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

diff between memmove & memecpy

1. How would you use the functions memcpy(), memset(), memmove()?
Nov 13 '05
71 4393
ng**********@re diffmail.com (R. Rajesh Jeba Anbiah) writes:
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote in message
news:<bk******* ***@oravannahka .helsinki.fi>.. .
ROSY <de************ **@rediffmail.c om> scribbled the following:
PS. Please don't top-post.


http://www.faqs.org/docs/jargon/T/top-post.html This link is for
Debashis who may not be knowing what is top-post. In simpler terms,
top-post means posting answers above the questions.

[correct format...]
> What is your name?

Debashis

[wrong format...]

Debashis
> What is your name?


Except that new text should not be indented. Indentation, like "> ",
usually indicates that you're quoting something. (I usually use
4-space indentation when quoting sections of the standard, "> " when
quoting portions of a previous article.)

So the correct format is:
What is your name?

Debashis

Source code, of course, should be indented for legibility.

--
Keith Thompson (The_Other_Keit h) ks*@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 13 '05 #31
Default User <fi********@com pany.com> wrote in message news:<3F******* ********@compan y.com>...
ROSY wrote:
Lastly ur really damned.

*plonk*


Brian Rodenborn


I dont know why this OT is such a long one?
Nov 13 '05 #32
U want 2 answer the levels of question,i think ur rubbish again,the questions
fuck urself understand.if u take challenge then i'm going on further.But if u
dont give any response ur jugglery come 2 at an end.
Really ur fooing the bar.

Randy Howard <ra**********@F OOmegapathdslBA R.net> wrote in message news:<MP******* *************** **@news.megapat hdsl.net>...
In article <73************ **************@ posting.google. com>,
de************* *@rediffmail.co m says...
for RANDY,
hello,
thanks 4 ur rubbish & stupid response.


You're welcome, I try to keep my responses on or above
the level of the questions. In this case, that was
extremely easy. There is a popular saying that goes
"Ask a stupid question, get a stupid answer". Your
question wasn't stupid per se, but it was so incredibly
broad ("How would you use the functions....") as to
be impossible to answer with any hope of it being of
use to you.
U just waste my valuable time.

Right. I thought it was the other way around.
Don't be silly guy.Take care of urself.I just believe in laugh,but
obviously not responding in this stupid way.Altime joking with allthings
not good,Damned.Als o dont waste ur time & groups member.


I'll pretend like I parsed the above correctly and just move on.
Lastly ur really damned.


Outstanding. Thanks so much.

Nov 13 '05 #33
ROSY <de************ **@rediffmail.c om> scribbled the following:
U want 2 answer the levels of question,i think ur rubbish again,the questions
fuck urself understand.if u take challenge then i'm going on further.But if u
dont give any response ur jugglery come 2 at an end.
Really ur fooing the bar.


Were you born this ignorant, or did you have to take a course? *PLONK*

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"'It can be easily shown that' means 'I saw a proof of this once (which I didn't
understand) which I can no longer remember'."
- A maths teacher
Nov 13 '05 #34
It is best 2 not spoke ur nose on this matter.
bye,


Mark McIntyre <ma**********@s pamcop.net> wrote in message news:<ei******* *************** **********@4ax. com>...
On 23 Sep 2003 19:10:59 -0700, in comp.lang.c ,
de************* *@rediffmail.co m (ROSY) wrote:
for RANDY,
hello,
thanks 4 ur rubbish & stupid response.U just waste my valuable
time.


But yet you think its ok to post a trivial question which wastes the
considerably more valuable time of the C regulars here, and which any
textbook would answer?

Top tip: READ A BOOK if you want to know how to answer your homework,
especially for such trivia.

By the way, Randy did in fact answer your question. What, you didn't
understand the answer? Perhaps thats because you need to learn basic C
first.

Nov 13 '05 #35

On Fri, 25 Sep 2003, ROSY wrote:

It is best 2 not spoke ur nose on this matter.
bye,

Gee, all those guys who plonked ROSY don't know
what they're missing. :-)

It is probably not significant that a Google Groups
search on "author:ROS Y" suggests the "Related Groups"
of comp.lang.c.* and soc.sexuality.s panking...

-Arthur,
now I'll be quiet
Nov 13 '05 #36
"ROSY" wrote on 26 Sept 03:
U want 2 answer the levels of question,i think ur rubbish again,the questions fuck urself understand.if u take challenge then i'm going on further.But if u dont give any response ur jugglery come 2 at an end.
Really ur fooing the bar.


I appreciate that English is not your first language, but could you at
least attempt to make sense when posting - even if it means asking a
friend to translate for you.

Secondly, don't swear. Though most of the readers are adults, there's
no need.

Lastly, don't top-post.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.u k (remove [no-spam] to reply)
Nov 13 '05 #37
pete wrote:
Thomas Matthews wrote:
ROSY wrote:

1. How would you use the functions memcpy(), memset(), memmove()?


There is also memcmp().

Are you out of your MIND !?
OP's question is CLEARLY only about the string functions
which return type pointer to void, and which have side effects.

Anyway, the answer to the question is here:

http://anubis.dkuug.dk/jtc1/sc22/wg14/www/docs/n869/


FYI, the mem*() functions are not string functions. The string
functions are str*(), and work with NULL terminated character
arrays.

They do have side effects, which is their behavior.

Try this one:
#include <stdio.h>
#include <string.h>

#define BUFFER_LENGTH 64

int main(void)
{
const char * test_text = "How are you?\n\0\nMr. Potato?\n";
char result[BUFFER_LENGTH];
unsigned int i;

memset(result, '\0', 256);
/* string test */
strcpy(result, test_text);
for (i = 0; i < BUFFER_LENGTH; ++i)
{
putchar(result[i]);
}

/* memcpy test */
memcpy(result, test_text, sizeof(*test_te xt));
for (i = 0; i < BUFFER_LENGTH; ++i)
{
putchar(result[i]);
}
return 0;
}
--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Nov 13 '05 #38
ROSY wrote:
U want 2 answer the levels of question,i think ur rubbish again,the questions
fuck urself understand.if u take challenge then i'm going on further.But if u
dont give any response ur jugglery come 2 at an end.
Really ur fooing the bar.


ROSY,

Eye relly dont unnerstan Y U abreviat the short words but spel owt
da big wons.

I guess there isn't any convenient shorthand for "jugglery" or
"challenge" . By the way (BTW), you (U) can shorten the word
"question" to "q's". If you can spend the extra time to type
out "your" instead of "ur" or "to" instead of "2", please don't
bother to type.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Nov 13 '05 #39
Thomas Matthews <Th************ **********@sbcg lobal.net> writes:
[...]
I guess there isn't any convenient shorthand for "jugglery" or
"challenge" . By the way (BTW), you (U) can shorten the word
"question" to "q's". If you can spend the extra time to type
out "your" instead of "ur" or "to" instead of "2", please don't
bother to type.


I guess you can also abbreviate "can't" to "can". 8-)}

--
Keith Thompson (The_Other_Keit h) ks*@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 13 '05 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
5550
by: Mac | last post by:
$ cat junk27.c #include <stdio.h> #include <string.h> int main (void) { printf("The difference between memcpy and memmove is %ld\n", (long int) memcpy - (long int) memmove); return 0; }
21
5283
by: Method Man | last post by:
Just a few theoretical questions I had on 'memmove': 1. Is there ever a good reason to use memcpy instead of memmove? 2. Is memmove useful to copy structs (as opposed to = operator)? 3. In general, when should memmove explicitly be used?
12
3168
by: Ian | last post by:
I read the FAQ about the differences between memcpy() and memmove(). Apparently memmove() is supposed to be safer. Just to make sure I understand the concept of memmove(), can someone tell me if this little function is using memmove() correctly? void strdel(char *s, size_t offset, size_t count) { if ((!s) || (offset > strlen(s)) || (count > strlen(s))) return; memmove(s+offset,s+(count+1),strlen(s)-count);
6
6094
by: novice | last post by:
Please explain with an example whts the DIFFERENCE between "memcpy" and "memmove"
6
1729
by: wenmang | last post by:
Here is the code which causes core dump when is built differently, 1 for regular dev built, the other for packaging build. class my_class{ public: my_class(){}; ~my_class(){}; private: string myData1;
14
2808
by: somenath | last post by:
Hi All, I am trying to understand the behavior of the memcpy and memmove. While doing so I wrote a program as mentioned bellow . #include<stdio.h> #include<stdlib.h> #include<string.h> #define SIZE_OF_DST 3 int main(void)
4
3411
by: gsi | last post by:
Hi all, memmove() is guranteed to work correctly if the objects overlap, I am not sure why this can't be done without any extra condition check in code for the memmove() implementation or why would memcpy() fail in this situation. Please advice. Thanks in advance, Gsi.
3
3685
by: Chris | last post by:
Hello all, Not sure if this is off topic, if it is I apologise in advance. Is it safe to use memmove() on an array of objects? I create an array of Objects and I have a cursor to indicate how many of those objects are in use. The one cravat is that the there are no unused objects (gaps) between the first element of the array to the cursor.
0
9777
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11109
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10728
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10405
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3227
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.