comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Recommended style - 21 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d8499543f20ad6a5 * problem abt printf on Turboc - 14 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8c6c0656bf1152bd * do{..}while(0) macro substitutions - 13 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c4667196cd7de262 * A POP3 tutorial? - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cc6a84d3c049bcc0 * malloc error checking - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d5a2302a7a8c9437 Active Topics ------------- linker: does it skip unused functions? - 1 new ---------------------------------------------- ...My esteem. Do you think that's what I'm after? - Thurs, Dec 30 2004 9:08 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dae008f2ad1dc890 Address syntax - 7 new ---------------------- ...Still l_SYM_2B has to copy an entire struct v1 into *lp_v1. That is heavy copying (and, moreover, leaving compilers less opportunities to optimize it away). Regards, Dietmar Schindler - Thurs, Dec 30 2004 9:08 am 7 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/59301cd1e7039807 understand a large system in C - 4 new -------------------------------------- ccwork wrote on 30/12/04 : ...I guess you meant 'a large project'... ... Welcome to the real world. Some tools can help like DOxygen. [link] (sounds that [link] where the server is hosted is down at the moment...) ...Now, I'm quite sure that when you will write your own project, you will - Thurs, Dec 30 2004 9:14 am 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d32a54a75402d344 How to change a file's name through the C program? - 1 new ---------------------------------------------------------- Bruce Sam wrote on 30/12/04 : ...rename() - Thurs, Dec 30 2004 9:17 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2f4ddd6bcdb7ba73 problem abt printf on Turboc - 14 new ------------------------------------- ...But "we" can't ignore a couple of fns in my (quasi?)C code I posted not long ago? Hm. (Note to self: Borland good, Microsoft bad.) ...Just about every != every. - Thurs, Dec 30 2004 9:19 am 14 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8c6c0656bf1152bd Recommended style - 21 new -------------------------- Kelvin Moss wrote on 30/12/04 : ...The first one. No option! - Thurs, Dec 30 2004 9:18 am 21 messages, 13 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d8499543f20ad6a5 help with va_list etc - 2 new ----------------------------- Alex wrote: ...Please do not top-post. Write your answer below the text you are referring to. There are essentially 3 ways to communicate the number of arguments - explicit: one of the mandatory arguments is the number of ( optional or total) arguments. Example: double sumN (int N, ... /* doubles */) - Thurs, Dec 30 2004 9:33 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/96adaf30f4b2b73 gcc: error: case label does not reduce to an integer constant - 5 new --------------------------------------------------------------------- I'm using Google Groups. It must have dropped the space. Still liked the program. :) Lonny - Thurs, Dec 30 2004 12:57 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fb0c6578b250322b is NULL-checking redundant in accessor-functions? - 1 new --------------------------------------------------------- Emmanuel Delahaye wrote on 30/12/04 : ...Actually, I was thinking of a creator rather than an accessor. But the idea is nearly the same : What is returned is a copy of the value of the pointer (Actually, the value of this->name, that can be valid or not, It belongs to the user). It's safe, but the user must test it against NULLL before going - Thurs, Dec 30 2004 10:03 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fc3530088eb3edbc Whats the difference between the yahoo group and this google groups? - 6 new ---------------------------------------------------------------------------- r there any files which we can download from this group. can we only ask questions in this group? no files stored like it is there in yahoo groups. i think it should be there in group services. ur new group member Ram 20/m/India e-mail id: [EMAIL PROTECTED] [EMAIL PROTECTED] - Thurs, Dec 30 2004 1:34 am 6 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/83aca04b5a04eb97 random is not random enough? - 2 new ------------------------------------ ...<snip> ...<snip> Don't beat yourself up. By that standard, almost everyone on both ng's is an idiot. With li'l'ol' me right at the top of the list. - Thurs, Dec 30 2004 10:45 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7f307ea8667d7b6b Name help needed - 5 new ------------------------ ...with lcc-win32 sizeof(long) == sizeof(int), so that's not needed. For long longs, only the new machines (amd64, Intel prescott), can seek a 64 bit number in a 64 bit number table. But maybe I should add those functions in software, actually it would be a good idea. - Thurs, Dec 30 2004 10:53 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d42b2ff2b7fd234b gcc bug with const on multidimentional arrays ? - 2 new ------------------------------------------------------- ...I think that the above code should be changed to const int i[][1] = {{1}}; isn't it? - Thurs, Dec 30 2004 11:02 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/163e062d59796e61 Got time? - 1 new ----------------- ...<snip> ...It is good practice to implement some of the easier stuff yourself. Electronics engineers in training start with resistors, capacitors and transistors instead of complete IC's, latin students start with little, simple sentences instead of Tacitus Historiae or Annales. Afterwards you can - Thurs, Dec 30 2004 11:03 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a77c1d53b6055c04 Is C99 the final C? (some suggestions) - 1 new ---------------------------------------------- nah nah da's - Thurs, Dec 30 2004 5:47 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/df6c22008b67bf55 Help with Constant Define--Compiler Issue with ANSI or my compiler or me? - 2 new --- ...Let me say that he is not telling you that. For the equality operation, the (long) operand -1L is converted to the type of the (unsigned long) operand 0 xFFFFFFFFL. Consequently, the expression evaluates to 1 (true). - Thurs, Dec 30 2004 11:56 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f010d7f1ff0f5c1c Creating a virtual File pointer - 4 new --------------------------------------- ... Unfortunately not, C has no way to direct output through a FILE * to a string. C has separate functions for writing to string e.h. sprintf() instead of fprintf() which unfortunately doesn't help in the situation you describe below. ...The simplest and portable approach would be to write the data to a - Thurs, Dec 30 2004 11:16 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ba964198fa07035e Problem with ABS() macro - 2 new -------------------------------- ...... ...True, and for the same reason most macros don't bother to parenthesise macro arguments that are passed on as function/macro arguments in the macro body, e.g. ...Good catch, and very sneaky. A macro expanding to an unparenthesised expression, especially a comma operator is pure evil. If anything is is - Thurs, Dec 30 2004 12:21 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/355864013e23345d A POP3 tutorial? - 9 new ------------------------ Hi I would like to write my own anti-spam filter (for Windows 98) but I've no idea how you intercept the incoming POP3 stream. Can anyone recommend a book ( or webpage) that could get me started? Thanks (and happy New Year). - Thurs, Dec 30 2004 12:54 pm 9 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cc6a84d3c049bcc0 const function() !!?? - 5 new ----------------------------- Do we have something called a const function ? I thought applying the 'const' specifier to a function is meaningless... but when i tried defining a const function it worked !! like... const int func(int a) { int b; ..... return b; .. . ...The above code gave no compilation errors ! :-> - Thurs, Dec 30 2004 5:44 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6078460cd9b93fae Coding standards - 1 new ------------------------ On 29 Dec 2004 21:58:30 EST, "Natt Serrasalmus" ...But that's just not true, except for the I/O functions. Most others return some value as a result, not as a diagnostic. I will write "if (a)" providing 'a' is a boolean. If not, I will write if (a != 0). If that bothers you, so be it. - Thurs, Dec 30 2004 8: 07 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/45fff8e456da3b6e malloc error checking - 9 new ----------------------------- At one point in my program I have about a dozen calls to malloc. I want ... if( (buffer_x = malloc(BUFSIZE * sizeof(*buffer_x))) == NULL) { exit(EXIT_FAILURE); fprintf(stderr, "malloc failed"); } for each individual call if there is a stylistically better way. How - Thurs, Dec 30 2004 3:13 pm 9 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d5a2302a7a8c9437 Specific problem...now you can help =) - 4 new ---------------------------------------------- On Wed, 29 Dec 2004 17:37:20 -0500, "tyler_durden" ...A stream, which is not necessarily a file. stdin can be a stream. Unlike gets, fgets can be told when to stop, preventing nasty buffer overflows that are possible with gets. ------- fgets gets a string from a stream Declaration: char *fgets(char *s, int n, FILE *stream); - Thurs, Dec 30 2004 11:53 am 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a07c053a6829c214 Is this standards compliant? - 7 new ------------------------------------ Aka, "How to make this warning go away?" I have some code that contains: ...I. e., a number that is greater than the limit for a signed 32 bit int. I cannot use the above in a statement w/o compiler (gcc 2.95) issuing a warning that says: decimal constant so large it must be unsigned. For example: unsigned int baz = FOO; - Thurs, Dec 30 2004 6:44 pm 7 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c99990be72a7f3fe about the keyword "register" - 1 new ------------------------------------ "Keith Thompson" <[EMAIL PROTECTED]> wrote ...I sort of agree as well. One of the strengths of C is that the programmer has a pretty good idea of what assembly will be generated, and thus an inutitive feel for how processor-intensive his function will be. However to extend this to assuming that "I have used a XOR therefore the instruction - Thurs, Dec 30 2004 7:13 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/24fe35bd10111bf7 using 8086 in C - 3 new ----------------------- hi friend, i've been making 8086 programs in TurboC editor and assembling it using TASM but now i want to know how to use both C statments along with x86 commands. I want"input from user to be used in manipulating operations in 8086 like input from user 'date and time' and set it using asm instructions." - Thurs, Dec 30 2004 12:43 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ac2d52a510371439 memcpy() Behaviour - 5 new -------------------------- hi all im very confused about using memcpy and i have three questions.... memcpy takes a pointer to src and a pointer to dest and copies src to destination...but im very confuzed about when to use '&' operator while using memcpy....i have code that use '&' and the code that call memcpy without '&' like is the following same - Thurs, Dec 30 2004 1:57 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/23d0119aa9fea403 Command Line compiling API and MFC programs - 3 new --------------------------------------------------- How does not compile a Windows API and a Windows MFC program from the command line with Visual.net. (I can do the former, at least, with Visual Studio by creating a "Win32 Project.") However, I tried the same thing on the command line. (In the days of Visual C++ 4.0 through Visual C++ 6.0, I had some - Thurs, Dec 30 2004 5:18 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/73ea5f55658cc1f4 Using Assembly Procedures with C - 1 new ---------------------------------------- basically it's *very* hard to do it any other way than using an __asm block, so just put __asm {..<your assembly here > ..} in your function. Doing it any other way is possible and some would argue better but to be honest I've tried it and it's far more trouble than it's worth, an immense PITA for what you would think would be an easy process. Oh no. Basically I - Thurs, Dec 30 2004 11:24 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/45a78ca8c8af94a6 do{..}while(0) macro substitutions - 13 new ------------------------------------------- A lot of times when reading open software, i come across macros that are defined as follows: ...do { \ func1(x); \ func2(x); \ func3(x); \ ...now, of course this will work but how is this any better than: ...{ \ func1(x); \ func 2(x); \ func3(x); \ ...i can't see how the compiler can optimize (a) any better than (b) or in - Thurs, Dec 30 2004 11:29 pm 13 messages, 10 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c4667196cd7de262 initializing data at compile time - 1 new ----------------------------------------- Op Mon, 20 Dec 2004 00:40:07 +0000, schreef Bart Goeman: ...i found a solution myself abusing enums. bash:pan$ cat menu.h DEFMENU( MENU_CLUTCH,"Clutches", clutchheaders) DEFMENU( MENU_GEAR,"Gears",gearheaders) bash:pan$ cat parameter. h DEFPARAMETER( P_CLUTCHON,"clutch on pressure",clutchon,MENU_CLUTCH) - Fri, Dec 31 2004 4:24 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4db0af250f645590 problem with fgets - 1 new -------------------------- Perhaps the OP meant something like this: ...int main(int argc, char **argv) { FILE *p_file; static char *filename = "test"; char *s = NULL; int c; unsigned character_count = 0; char *pname = "This program"; static const unsigned pointless_moronic_constant = 5; - Thurs, Dec 30 2004 8:24 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f1bdcf398d38bd67 printf - 3 new -------------- Somewhat related to the FAQ: 18.13: Where can I find the sources of the standard C libraries? A: The GNU project has a complete implementation at [ link]. Another source (though not public domain) is _The Standard C Library_, by P.J. Plauger (see the Bibliography). See also questions 18.9b, 18.15c, and 18.16. - Thurs, Dec 30 2004 8:33 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e860a642872579b tricky assignment statemenent - 4 new ------------------------------------- Consider the following code: ...struct s { /* ... */ struct s * next; ...void f(struct s * q) { struct s * p = malloc(sizeof *p); if (p != 0) { p = p->next = q; /* is this safe? */ } ...In the context given above, is the statement "p = p->next = q;" safe and equivalent to "p->next = q; p = q;" - Fri, Dec 31 2004 6:18 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/45f0f3ca1bb5499f ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.c" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.c To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.c/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
