Description:
Discussion about C.
|
|
|
list certain files inside directory
|
| |
Hi There, I would like to list all files in a defined direcory that match a certain pattern. I would like to get the paths from every file that matches "/usr/share/ NovaxTSP/log_record*". I understand that I need to be using opendir() but haven't quite figured out how i can do that. Any suggestion, hints or examples are appreciated!... more »
|
|
SuperKISS for 32- and 64-bit RNGs in both C and Fortran.
|
| |
On Nov 3 I posted RNGs: A Super KISS sci.math, comp.lang.c, sci.crypt a KISS (Keep-It-Simple-Stupid) RNG combining, by addition mod 2^32, three simple RNGs: CMWC(Complementary-Multiply-Wi th-Carry)+CNG(Congruential) +XS(Xorshift) with resulting period greater than 10^402575. The extreme period comes from finding a prime p=a*b^r+1 for... more »
|
|
K&R hash table question.
|
| |
Hi, I've encountered some confusing questions while reading k&r ed2. Around page 128, in the book, has introduced an "hash-search algorithm", while they uses hash(s) which is the hashed number of an string, as the array index, this had raised my question: doesn't array indexes have to start from 0 to (i-1), but random assigning index is... more »
|
|
cascading stdarg calls
|
| |
Hi, the code below prints a garbage "world" value to <messages>; "Hello " is fine. What can be the problem? static char messages[LARGE_ENOUGH]; int writeText(char* text, char* format, ...) { va_list argumentList; va_start(argumentList, format); vsprintf(text, format, argumentList); va_end(argumentList);... more »
|
|
a simple question about typedef void* KEYWORK
|
| |
As a C beginner,I want to ask a "silly" question about typedef: IS typedef [something1] [something2] means " someting1 is something2" SUCH AS typedef struct node{ int a; int b; ...show us NODE is struct node {...} ,when we met NODE, we should take is as struct node{...} ,no problem.... more »
|
|
Endianness macros
|
| |
[ NB: cross-posted to comp.lang.c and comp.arch.embedded ] Hello everyone, I'm having trouble understanding some endianness-related macros provided on my platform. <quote> typedef volatile U32 FOOBA_MU32; typedef volatile U16 FOOBA_MU16; typedef volatile U8 FOOBA_MU8; /* ------------------------------ ------------------------- */... more »
|
|
|