programming wiki needs you

P

pete

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.
 
A

Arild Hystad

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top