W
Walter Dnes
I have taken an intro evening C course at a local university, but my
C programming experience is otherwise nill. I've come up with a little
project that I want to cut my teeth on. After reading the FAQ, I have a
few questions
1) What proportion of modern OSs/compilers would a string in excess of
64K charcters break ?
2) Is memmem a standard function in C ? I want to find if and where a
smaller string exists within a larger string. Spelunking through
/usr/include/string.h (Redhat 7.3; gcc 2.96) I find...
#ifdef __USE_GNU
/* Find the first occurrence of NEEDLE in HAYSTACK.
NEEDLE is NEEDLELEN bytes long;
HAYSTACK is HAYSTACKLEN bytes long. */
extern void *memmem (__const void *__haystack, size_t __haystacklen,
__const void *__needle, size_t __needlelen)
__THROW __attribute_pure__;
The call looks simple. The parameters would be
- pointer to larger (containing) string
- containing string size (why size_t rather than int ?)
- pointer to substring
- substring size (why size_t rather than int ?)
If the function is void, how do I find out what it has returned ?
3) Is there a list somewhere on the web of standard functions and the
libraries they're found in ?
4) What does fubar_t signify, where fubar can be anything ? This
looks like some sort of standard naming convention.
C programming experience is otherwise nill. I've come up with a little
project that I want to cut my teeth on. After reading the FAQ, I have a
few questions
1) What proportion of modern OSs/compilers would a string in excess of
64K charcters break ?
2) Is memmem a standard function in C ? I want to find if and where a
smaller string exists within a larger string. Spelunking through
/usr/include/string.h (Redhat 7.3; gcc 2.96) I find...
#ifdef __USE_GNU
/* Find the first occurrence of NEEDLE in HAYSTACK.
NEEDLE is NEEDLELEN bytes long;
HAYSTACK is HAYSTACKLEN bytes long. */
extern void *memmem (__const void *__haystack, size_t __haystacklen,
__const void *__needle, size_t __needlelen)
__THROW __attribute_pure__;
The call looks simple. The parameters would be
- pointer to larger (containing) string
- containing string size (why size_t rather than int ?)
- pointer to substring
- substring size (why size_t rather than int ?)
If the function is void, how do I find out what it has returned ?
3) Is there a list somewhere on the web of standard functions and the
libraries they're found in ?
4) What does fubar_t signify, where fubar can be anything ? This
looks like some sort of standard naming convention.