470,841 Members | 948 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,841 developers. It's quick & easy.

programming wiki needs you

i'm starting a programming wiki so we have a one stop place to find
source code for all languages. if anyone would like to help check out
http://www.coderwiki.com/wiki

thanks!

Aug 15 '06 #1
4 1263
"da404LewZer" <da*********@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
i'm starting a programming wiki so we have a one stop place to find
source code for all languages. if anyone would like to help check out
http://www.coderwiki.com/wiki
Someone beat you to it:
http://sourceforge.net/

What was your C question?

Aug 15 '06 #2
dc*****@connx.com wrote:
>
"da404LewZer" <da*********@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
i'm starting a programming wiki so we have a one stop place to find
source code for all languages.
if anyone would like to help check out
http://www.coderwiki.com/wiki

Someone beat you to it:
http://sourceforge.net/

What was your C question?
Oh come on, don't you even want to correct his mistakes?

For C:memcmp

This next line is wrong:
Synopsis: int memcmp(const char *s1, const char *s2, size_t n)
It should be:
Synopsis: int memcmp(const void *s1, const void *s2, size_t n)

This next line is wrong:
Successful return: 0 if equal, negative if s1<s2, positive if s1>s2

It should be:
0 if *(unsigned char *)s1 == *(unsigned char*)s2,
negative if *(unsigned char *)s1 < *(unsigned char*)s2,
positive if *(unsigned char *)s1 *(unsigned char*)s2.

--
pete
Aug 16 '06 #3
On Wed, 16 Aug 2006 01:26:28 +0000, pete wrote:
dc*****@connx.com wrote:
>>
"da404LewZer" <da*********@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegr oups.com...
i'm starting a programming wiki so we have a one stop place to find
source code for all languages.
if anyone would like to help check out
http://www.coderwiki.com/wiki

Someone beat you to it:
http://sourceforge.net/

What was your C question?

Oh come on, don't you even want to correct his mistakes?
Actually, these are not the OP's mistakes, but mine :-(
For C:memcmp

This next line is wrong:
Synopsis: int memcmp(const char *s1, const char *s2, size_t n)
It should be:
Synopsis: int memcmp(const void *s1, const void *s2, size_t n)
Thanks for telling about this error. I have fixed it now.
This next line is wrong:
Successful return: 0 if equal, negative if s1<s2, positive if s1>s2
This was a non-successfull attempt at a compact description. I have
changed it to a more verbose text, but am not yet happy with it.
It should be:
0 if *(unsigned char *)s1 == *(unsigned char*)s2,
negative if *(unsigned char *)s1 < *(unsigned char*)s2,
positive if *(unsigned char *)s1 *(unsigned char*)s2.
This is also wrong. memcmp() compares a range of characters, not only the
first (unless n==1).

There are probably lots of other similar errors in the C pages. Most of
them where made by copying from another page and changing the
parts where there are differences. I have probably overlooked some
important differences. I haven't had the time to check all of them yet.

This is a wiki, where anyone is allowed to edit, and all C articles needs
error checking, expansion and better examples. There is also an incomplete
list of missing pages on C:Todo.

So, if someone at comp.lang.c is tired of telling yet another newbie that
his post is off-topic, he/she can come to CoderWiki and write some
documentation.

--

Arild Hystad

Aug 16 '06 #4
Arild Hystad wrote:
>
On Wed, 16 Aug 2006 01:26:28 +0000, pete wrote:
It should be:
0 if *(unsigned char *)s1 == *(unsigned char*)s2,
negative if *(unsigned char *)s1 < *(unsigned char*)s2,
positive if *(unsigned char *)s1 *(unsigned char*)s2.

This is also wrong. memcmp() compares a range of characters,
not only the first (unless n==1).
OK

--
pete
Aug 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by mrby | last post: by
2 posts views Thread by Kenneth McDonald | last post: by
65 posts views Thread by Giannis Papadopoulos | last post: by
302 posts views Thread by Lee | last post: by
1 post views Thread by da404lewzer | last post: by
reply views Thread by Jeff Rush | last post: by
2 posts views Thread by _A_C-ker_ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.