Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Designing > HTML/CSS
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-06-2009, 04:35 AM
Junior Member
 
Join Date: Mar 2009
Posts: 2
Default tell me the difference!!!!!!!!!!!!!

Hi,
Can anybody please tell me the difference between memcmp() and
strncmp() functions ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-11-2009, 05:13 AM
Junior Member
 
Join Date: Mar 2009
Posts: 20
Default

What we're looking for are ideas, not Pulitzer Prize writers. Ideas are what fuel our magazine and our website. Now we want to expand that concept into eBooks for expats. You don't have to be a professional writer to submit a report that provides important information - - information that you yourself have learned by having been there and done it. That is exactly what our readers are seeking, facts about living overseas from people who've done it. Yes, you can make money from a good report or two... possibly a lot.
For more information visit:
YOURBIKESITE
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-26-2009, 04:48 AM
Junior Member
 
Join Date: Mar 2009
Posts: 1
Default

"Preets" <pratibha.here@gmail.com> wrote:

> Can anybody please tell me the difference between memcmp() and
> strncmp() functions ?


strncmp() stops at a null byte as well as at n bytes.
E.g., suppose you have the following:

at address a, you have the string "abcde", followed (of course) by a
terminating null character, followed by four chars of garbage;
at address b, you have the string "abcde", followed by a null char,
followed by four chars of different garbage than that at a;

then strncmp(a,b, 10) would return 0, since the _strings_ at those
addresses are equal, up to the first terminating null;
but memcmp(a,b, 10) would return a non-zero value depending on whether
the garbage at a is greater or smaller than that at b.
__________________
Website Design Web Design visa India
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2009, 11:37 PM
Junior Member
 
Join Date: Apr 2009
Posts: 9
Default

memcmp() function:
Description:
The memcmp function compares the first n characters of the object pointed to by s1 to the first n characters of the object pointed to by s2.
Returns:
The memcmp function returns an integer greater than, equal to, or less than zero, accordingly as the object pointed to by s1 is greater than, equal to, or less than the object pointed to by s2.

strncmp() functions:
Description:
The strncmp function compares not more than n characters (characters that follow a null character are not compared) from the array pointed to by s1 to the array pointed to by s2.
Returns:
The strncmp function returns an integer greater than, equal to, or less than zero, accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal to, or less than the possibly null-terminated array pointed to by s2.
________
NiceTits4You

Last edited by Leo Rupert : 08-20-2011 at 10:52 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 07:52 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.