comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Compiler warning level (was: Character arrays) - 13 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d7360ceb0613160 * Golf Competitions - 8 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/55b43d0bd0d44eb * Arraym malloc() and free() question - 7 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6c0e0b0f81ee43bf * Meaning of Packed and Local types - 7 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e59f2fd649cef73 * The C language on Mars - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40888ed3d75514c8 Active Topics ============= Obfuscate C tricks - all new ---------------------------------- Opps. You are correct the one and zero should be swapped round. ... "Christian Staudenmayer" wrote in message news:[EMAIL PROTECTED] lan... ... ... - Fri, Nov 12 2004 12:30 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/20eafe92fac9409c Giving the preorder & inorder lists, How can be constructed the corresponding B-TREE ? - 2 new ---------------------------------- ... Did you recognize that the code posted was a joke? It was something that worked (actually I assume this, I never tried the code), but was intentionally obfuscated such that you cannot hand it in directly. It is a way of saying: Do your own homework. ... - Fri, Nov 12 2004 12:41 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/68744af9e196542d Float point comparison-Newbie - 2 new ---------------------------------- ... I suspect that the fact that it it is DECIMAL is the key issue here. ... Which is the problem - how to handle in binary floating point quantities which are fundamentally decimal in nature (e.g. values in most monetary systems). . .. Which makes the binary floating point representation an approximation, but output routines that output decimal should still produce the correct exact result of 0.1. When you know a value can be expressed exactly to a limited number of decimal places and the error is suitably limited, this is... - Fri, Nov 12 2004 3:02 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/53ed451b64e71eb5 Golf Competitions - 8 new ---------------------------------- Hi, As you can probably guess from my posts so far I enjoy doing fun and interesting coding as a hobby. I was wondering if anyone knows of any Golf style competitions for C? (I.e. winner is the programmer whose program has the lowest number of characters in the source code that completes a specific task) If people don't know of one then perhaps we could arrange an informal one. ... ... - Fri, Nov 12 2004 3:12 am 8 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/55b43d0bd0d44eb Please review - all new ---------------------------------- ... ... ... There's always union. And the addition of qualifiers like const certainly result in a different type. Lawrence ... - Fri, Nov 12 2004 3: 16 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c252fbe59cd39db0 using volatile ptrs ... - all new ---------------------------------- ... Yes, that's me! Lawrence ... - Fri, Nov 12 2004 3:19 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ee0d0fd6df1c903 2 q's re sedgewick's algorithms in c parts 1-4 book - all new ---------------------------------- (this isn't going to make any sense unless you have sedgewick's "algorithms in c parts 1-4" (but the 2nd question might make sense)) page 484, program 12.2 -- exactly what code/files should be used with it in order to compile program 12.2? there's two lines: ... look on the book's support site and found all the code but there's no indication of any file names. also i don't see 'Key' declared/typed/or whatever the correct phrase is anywhere in all the code, not once. so basically, what do i need in order to... - Fri, Nov 12 2004 3: 28 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f833f07c323a6c9c Compiler warning level (was: Character arrays) - 13 new ---------------------------------- On Tue, 09 Nov 2004 15:23:06 +0100, Michael Mair ... I use -W as well, it catches a few more warning cases (comparing unsigned values as < or <= zero, a < b < c (one it actually caught the other day, I'd deleted too many characters) , unused arguments). They aren't essential for ANSI but they can show up errors (or things which need implementing, like using the function arguments). ... That's what make is for... ... Introduce them to make? Chris C ... - Fri, Nov 12 2004 3:42 am 13 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d7360ceb0613160 Arraym malloc() and free() question - 7 new ---------------------------------- ... ... I can't see any undefined behaviour if the code supplies the correct prototype for malloc. Which is perfectly possible, because there are several other headers defining size_t. Dan... - Fri, Nov 12 2004 4:30 am 7 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6c0e0b0f81ee43bf array subscripting - 2 new ---------------------------------- ... Since I'm replying to a fairly old article I won't snip. ... That doesn't make much sense to me. The standard requires there to be no padding between array elements. When you have an array of arrays this applies at all levels. Consider this: ELTYPE (*p)[NCOLUMNS] = malloc(sizeof(ELTYPE) * NROWS * NCOLUMNS); If the malloc() succeeds (and the byte size of the desired array is representable as a size_t) is it guaranteed to allocate enough space to hold the array? I would be worried if not. If it is then there... - Fri, Nov 12 2004 4:42 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/818f1182b855b0ca fork(): how can I kill forked process and all ITS children, but leave parent alive? - 2 new ---------------------------------- I am trying to write a program that will fork a process, and execute the given task... the catch is that if it runs too long, I want to clean it up. this seemed pretty straight forward with a single executable being run from the fork. The problem I am having now is that if I call a shell scripts, then lets say calls "xterm &", after the timeout has occurred, I kill the shell script, but the xterm is still running... I cannot seem to kill the "xterm" without giving a vicious enough kill that ends up ... - Fri, Nov 12 2004 5:24 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/eb3ce25f9675a4f4 EOF character - all new ---------------------------------- ... Again, misspelling fread() ... - Fri, Nov 12 2004 5:41 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4e284fe26bfa7fbd The C language on Mars - 6 new ---------------------------------- Mohd Hanafiah Abdullah spoke thus: ... And look at how active this newsgroup is :) ... - Fri, Nov 12 2004 5:58 am 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40888ed3d75514c8 convert 'C' code to 'Fortran' - 6 new ---------------------------------- ... It's not the main program you want to write in Ada, but the interface between the C and the Fortran code. I.e. if the Fortran code needs to call a C function, provide an Ada wrapper that is Fortran callable and that knows how to call the C function. Then again, it is not clear how portable the solution would be in the real world (see your own parenthetical remark). Dan... - Fri, Nov 12 2004 5:48 am 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7d307a1eec1f217a address of a statement in C - all new ---------------------------------- ... So you believe from this: ... and this: ... you can conclude this: ... For an advocate of structure, that's quite a jump. ... - Fri, Nov 12 2004 5:56 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9c7bf5671accbcf6 Meaning of Packed and Local types - 7 new ---------------------------------- Hi all, I saw in one function that its return type was written as PACKED...I wasnt sure what that would mean. Any pointers on this? Also, what is the significance of specifically mentioning the LOCAL to a function definition when it will be a local function without the access of its declaration? Thanks Murali ... - Fri, Nov 12 2004 7:46 am 7 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e59f2fd649cef73 printing a pointer's value - 3 new ---------------------------------- ... You mean, write the pointer value? The address-like thing? Use the %p format specifier. ... Undefined behaviour. zp doesn't point anywhere (it's uninitialised). ... Because you are lucky today: the implementation has admitted that your code is wrong. On a bad day, it would have just printed 10, and you'd have thought what you'd done was OK. ... - Fri, Nov 12 2004 8: 17 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/87aa9d1f6665d1db Follow-up on Newsgroup Survey - all new ---------------------------------- ... ... Your statistics are flawed anyway. Brian ... - Fri, Nov 12 2004 9:21 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3f56d6df15f265aa homework problem - 5 new ---------------------------------- like, my homework is due at 4:30 pm central time Nov 19, and this stupid professor has no respect for my need to use my time elsewhere. He thinks that if the braces are off, then there's something wrong, but I got my braces off while dating Billy 2 years ago, and I was hotter, so I could start dating Chad on the hockey team. It's so nice to have a friendly place to talk about things:-) Anyways this professor wants me to use c to hurl a 10 kg ball from St. Paul to Chicago. He says that the physical constraints are idealized and that... - Fri, Nov 12 2004 10:01 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a6d5cc60dffdcbfd Recursive Calls with Ellipses - 3 new ---------------------------------- I'm trying to write a wrapper functions for a function that uses the stdarg.h ellipses notation for variable arguments. In essense, if the original function is: void foo(int n, ...){ //body ... I want to write a function like: void foo_wrapper (int n, ...){ //some stuff foo(n, ##SOMETHING##); // some other stuff ... Where the ##SOMETHING## is exactly what satisfied the "... ". How do I do this? I tried naively giving "foo" a va_list, but that lead to some fun segmentation errors. Any other thoughts? ... - Fri, Nov 12 2004 10:38 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8f29821466f8b7e7 strings - all new ---------------------------------- ... You've got the meaning of the buffer pointer wrong. It does _not_ "set the pointer to the string that was read". Rather, it puts the string where the pointer says to put it. Since s is uninitialized, as you noted, fgets will (attempt to) put the string at whatever address happens to be in s. If you're lucky, you will crash the program immediately, as it tries to write to memory that doesn't belong to the program. If you're unlucky, s will happen to point to valid memory, and who-knows-what will be... - Fri, Nov 12 2004 1:28 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/898216cde1cc4f1b nonzero != 1, right? - 5 new ---------------------------------- ... Note that, years ago, I worked on a system where boolean expressions returned either 0 or -1. (I'm sure this is before ANSI stepped in and said it must be 0 or 1.) ... - Fri, Nov 12 2004 1:22 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/26814eeabc379360 derangement: coding review request - 2 new ---------------------------------- On Thu, 11 Nov 2004 19:35:27 -0600, in comp.lang.c , "Merrill & Michele" ... The declaration or prototype tells the compiler what type of arguments to expect. If you then pass the wrong types, it has to convert them. This may be impossible. Or it may convert it to some garbage value. For example, passing 1 to a function expecting a pointer might cause it to create a pointer to memory address 1, which is often inside hardware memory. This is very likely to crash your computer. Some computers even use different memory... - Fri, Nov 12 2004 2:14 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/63c5271ccb9149a DOS to Windows - all new ---------------------------------- On Thu, 11 Nov 2004 22:20:22 -0500, in comp.lang.c , Allin Cottrell ... If we're being pedantic, command.com also isn't DOS - its the command interpreter which runs on top of DOS. You can disable that too. ... And most of them wold fsck up their macs and linux boxes just as well. Lets keep that to alt. advocacy.flames tho shall we? ... - Fri, Nov 12 2004 2:17 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4ca2aabf9d2c03ad Modify Static Data Okay? - 4 new ---------------------------------- Is it legit to modify static data like the following code? ... struct tbl { int i; char *s; ... struct tbl t[] = { { 10, "hello" }, { 12, "yoyoyoyoyoyoyoyoyoyo" } ... int main(void) { t[0].s = "something else"; /* modify the static table in place */ printf("%d %s\n", t[0].i, t[0].s); return EXIT_SUCCESS; ... Mike ... - Fri, Nov 12 2004 3:26 pm 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/38a3bbbb875bc9ac special character to strings and vice versa - all new ---------------------------------- ... OK, I'll remember it for next time. <snip code> ... Hmm, yeah that's probably the only way out. Thanks for your input tough. ... Well I'll just stick with the other version then. ... I'll look into it, thanks a lot Michael. Cheers Peter ... - Thurs, Nov 11 2004 11:43 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a42ff926b12a9709 hashlib package - all new ---------------------------------- ... My 2 cents: I think it would be a benefit to others to see some comparison to other implementations of hash tables, even (shame on me) in variants of C distributions. This eliminates repetitive work or work that is not at par with existing implementations. Hmm. ... - Thurs, Nov 11 2004 8: 54 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e5f87805e1fd8c3f Sprase matrix - all new ---------------------------------- ... Sparse matrices are mostly used for large linear algebra problems ( including solving partial differential equations), where it is important that the storage structure fits well with the access pattern of the algorithms being used. The matrices can indeed be very sparse: it is not uncommon to have the matrix size proportional to the square of the number of nonzero elements. Details are OT here; sci.math.num-analysis might be a better place. ...... - Fri, Nov 12 2004 8:05 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6cb646efd59ed710 Functions as function parameter - all new ---------------------------------- ... First Of always remember that you can not pass the function as the parameter to another function as the argument. Rather we Pass Only the address (Pointer) of the Fucntion as an argument. ...... - Thurs, Nov 11 2004 4:08 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f8b840ac2761f8f8 What does "void (*vector[])( )" means? - 2 new ---------------------------------- Is this a pointer array of function?If I was wrong,what does it means? ... - Fri, Nov 12 2004 5:37 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/848452dc513d5704 Simple vsscanf source code? - all new ---------------------------------- Hello, I realize that the source code for vsscanf is available from several sources, such as GNU. However, all such source code I've found so far is filled with cryptic (to me) #ifdefs, system stuff, and basically all kinds of general things related to a particular implementation. I'm looking for a simple concise generic C99 version that I can easily adapt into my application without having to look all over the place for a seemingly unending litany of cryptic "helper" functions. I'm sure I could write my ... - Fri, Nov 12 2004 9:34 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/920992148366b9db ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.c". comp.lang.c http://groups-beta.google.com/group/comp.lang.c Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.c/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.c/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
