comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Definition of NULL - 15 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6c604861d0d193ac * call to malloc with size 0 - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ac4d191d274907c6 * functions and main - 10 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2ee0766a9fdd1423 * Memory allocation by malloc - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ccf7007aa81f1932 * derangement: coding review request - 8 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/63c5271ccb9149a Active Topics ============= text fixed with graphics and eqations - 5 new ---------------------------------- ... Suggestion #1: Why don't you tell us what platform you are actually working on? If it is (as I suspect from the naming convention you use) a C++ framework, Suggestion #2: Find a newsgroup dedicated to your platform/ framework. I cnnot remember TRichEdit being part of the C language. ... - Wed, Nov 17 2004 12:51 am 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6ba5480a906ffd21 Definition of NULL - 15 new ---------------------------------- pete wrote: ... This would probably be a more better quote: N869 ... ... - Wed, Nov 17 2004 12:58 am 15 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6c604861d0d193ac call to malloc with size 0 - 12 new ---------------------------------- Hi Folks, I've a simple qestion related to dynamic memory allocation in C here is the code: ... int main() { char *p; if( (p=(char*)malloc(0)) = = NULL) printf("NULL\n"); else printf("Valid Pointer\n"); return 0; ... Output : "Valid Pointer" Why this code fragment returns a valid pointer to a memory block??? -Neo ... - Wed, Nov 17 2004 1:53 am 12 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ac4d191d274907c6 Opaque data type - 2 new ---------------------------------- Hi All, Could you tell how to implement opaque data type with an example ? Or link to a documentation will be great !! Thanks, Labora. ... - Wed, Nov 17 2004 2:04 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f64b02610fab5964 C/C++ code beautifier - 4 new ---------------------------------- On Wed, 17 Nov 2004 00:07:23 -0800, ... ... Not to mention that normally linux comes with a butifier, as did most unix systems for decades. Villy ... - Wed, Nov 17 2004 2:57 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/acd7f8376b921f9 update hash table - 2 new ---------------------------------- Hello, I am trying to use hash management (from ). I can add and search however I can't update entries in the hash table... In the manual I found following note: ... SVID and POSIX 1003.1-2001 specify that action is significant only for unsuccessful searches, so that an ENTER should not do anything for a successful search. The libc and glibc implementations update the data for the given key in this case. Individual hash table entries can be added, but not deleted ... Could you look at my example in the attached... - Wed, Nov 17 2004 3:13 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b78128ae1930de43 const members - all new ---------------------------------- ... ... ... Specifically they are incompatible types. ... Yes. ... It would take a pathological implementation to represent the two structures differently, but it is perfectly possible despite what the footnote in the standard implies. Padding between structure members has to provide suitable alignment for those members but isn't defined solely in terms of that, other factors can be takien into consideration. For example consider an array of 3 characters. That has to have 1 byte alignment (or I suppose 3 in theory)... - Wed, Nov 17 2004 3:16 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/193c2f433670ba08 EVIL FBI SADISTS should be HUNTED, KIDNAPPED and TORTURED for 3 YRS - 2 new ---------------------------------- Someone emailed and requested me to post it on Usenet newsgroups. Sadistic FBI agents should be tortured the way how FBI sadists and perverts tortured this poor guy (non-muslim) for three years and continue to torture him even after he left america tracking him with implanted transponder chips and other methods. FBI is an evil organization and those FBI sadists and perverts deserve to be kidnapped and their eyes gouged, noses and ears chopped off, forced to eat their own feces and drink their own piss and extra hot red chilli... - Wed, Nov 17 2004 3:38 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/edd6946fd11b3433 seems OT; will demonstrate relevance - 4 new ---------------------------------- ... query could further the ends of this forum? MPJ ... - Wed, Nov 17 2004 3:40 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/909d9b0c9ff87435 Question about setjmp on Itanium HPUX. - 5 new ---------------------------------- Hi, I've read this page - but don't understand it. Here's the text - "Non- standard usage of setjmp() and longjmp() could result in compatibility problems. The contents of the jmp_buf buffer are specific to the architecture and compilation environment. For example, this includes using jmp_buf in a user-defined structure and passing jmp_buf structures across relocatable objects. Objects built using these functions may not be supported for future architectures, such as IPF." What does it mean about passing jmp_buf... - Wed, Nov 17 2004 3:53 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d2ba06fe57d25c4e Sprase matrix - all new ---------------------------------- ... computational tactics in generality is beyond the scope of tapping out an e-mail message. MPJ ... - Wed, Nov 17 2004 4:06 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6cb646efd59ed710 Killfiles on RADP - 3 new ---------------------------------- On 15 Nov 2004 15:06:42 GMT, [EMAIL PROTECTED] (JRClarkJR) wrote: ... I have also killfiled Dave in Dallas, but for me I got tired of this racist views, which I view as hateful. ... ... - Wed, Nov 17 2004 4:08 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f2165af594a8c994 Memory allocation by malloc - 9 new ---------------------------------- Hi, Will someone please tell me, How malloc allocating memory from heap & what data structure it is using to do so. regards Ardhendu ... - Wed, Nov 17 2004 4:22 am 9 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ccf7007aa81f1932 functions and main - 10 new ---------------------------------- The following progs differ only in the location of the prototype (<--adjective) definition with respect to the main call. Both build and behave for me. Is there a difference that amounts to something once the subject matters gets stickier? MPJ ... int i = 5; void increment(int *); increment(&i); printf("i = %d\n",i); return 0; ... int tmp = *px; ++ tmp; *px = tmp; ... ... int main( void){ int i = 5; increment(&i); printf("i = %d\n",i); return 0; ... int tmp = *px; ++ tmp; *px = tmp; ... ... - Wed, Nov 17 2004 4:38 am 10 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2ee0766a9fdd1423 C = only language that easily deals with shared mem. access ? - 2 new ---------------------------------- ... Yes. C provides zilch support for *any* form of IPC, except ordinary files. Dan... - Wed, Nov 17 2004 4:17 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3eef7c0d54d7ae47 derangement: coding review request - 8 new ---------------------------------- ... Now, check the *definition* of "prototype" in the C standard and you might get the point. Dan... - Wed, Nov 17 2004 4:36 am 8 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/63c5271ccb9149a How does C cope if architecture doesn't address bytes? - 5 new ---------------------------------- ... This is not necessarily true on such an implementation, which may want to make all addresses byte addresses when converted to intptr_t. ... So what? The only problematic scenario is that starting with a char * that is not aligned on a word boundary. But you're starting with a double *, so all the conversion chain is likely to work without any problem. ... Again, if the char * is word aligned, no information is lost in the conversion. Dan... - Wed, Nov 17 2004 5:03 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/30200c2a3cb93e0a Directory/File recursive listing using standard/portable C? - 3 new ---------------------------------- ... It might be a major product for its vendor, it's still a legacy OS for those stuck with it. At a previous job, one of the main reasons they decided to get rid of their large mainframe configuration was precisely the lack of directory support. Dan... - Wed, Nov 17 2004 4:50 am 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6bb13eb49896e55a How to read data ? - 3 new ---------------------------------- Hay Guys can you all suggest me the points on the below issue Problem : The thing is that I have the data some thing like this. 1486, 2168, 3751, 9074, 12134, 13944, 17983, 19173, 21190, 21820, 1730, 2640, 3450, 4870, 6126, 7876, 15644, 17817, 20294, 21902, 2070, 3025, 4333, 5854, 7805, 9231, 10597, 16047.. ......................... soo onnnnnn now this data I have stored into the ABC.txt file. Now what I have to do is, that I have to read these data from the file in sequence from left to right. And store into the Buffer.... - Wed, Nov 17 2004 5:29 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a69e10059208d734 HP/UX Itanium C comiler & std C - all new ---------------------------------- ... Nope. You're not attempting to modify the result of the conditional operator. ... Apart from stylistic issues, your version is correct. In real code, you may want to either use a function pointer (if ignore_case doesn't change its value in "random" places during normal program execution) or to hide the conditional operator behind a macro (if it does). Dan... - Wed, Nov 17 2004 5:18 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d844682942ab73a2 cmsg cancel <[EMAIL PROTECTED]> - 2 new ---------------------------------- ignore Article cancelled by slrn 0.9.8.0 ... - Wed, Nov 17 2004 6:07 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6c9da19d34c18653 Subtracting 0 from one-past-end pointer - all new ---------------------------------- ... Nope, the standard explicitly allows it: ... The definition of C makes * reliable* bound checking at run time incredibly difficult, but your case can be trivially handled by a run time bound checker. Dan... - Wed, Nov 17 2004 5:49 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9a63ee6543fd5f1f unanswered questions - all new ---------------------------------- ... If they passed unanswered it is because either no one knew the answer or no one found them interesting enough to be worth his time. There is little point in reposting them. ... Yes, if they are topical for that newsgroup. Otherwise, try clcm. Dan... - Wed, Nov 17 2004 6:03 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7d3a6e6860d3c3b5 Pointer of array's ( example: get the third word of the sentence ) - 3 new ---------------------------------- The point was to make a program that gives you the possibilty to enter a sentence and when you press "enter" it should ask a number for example when i press 4 It should take the 4th word out of the sentence and print it example sentence "hello i am Anouar" the space after hello should not be a problem for the program so whe i ask for the second word it should give "i" for an answer.. this is what i've got so far can anybody help me? ... int woord, counter, pointer; char *wijzer[1000]; char zin[1000]; int main(){... - Wed, Nov 17 2004 6:21 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c9510aad1e74c1c0 char vs int - 8 new ---------------------------------- ... char *p; p=malloc(4); strcpy(p, "tja"); printf("%s\n", p); free(p); return 0; ... Why is p a char and not an int? MPJ ... - Wed, Nov 17 2004 6:40 am 8 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/513350d660d42aa4 Hash Tables & Linked Lists - all new ---------------------------------- Anyone knows where to get hash table and linked list implementation as a source code? ... - Wed, Nov 17 2004 6:13 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ec1885bd2daf7c1a Projects - 4 new ---------------------------------- Hey, Im in grade 12 computer science, and i was going to learn C for my final project, the only problem is, I need to make something out of C later on, and I have no idea's what I could make for my final project, after I learn C. Any Idea's? Thanks ... - Wed, Nov 17 2004 7:06 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ccd237f7b9a34c9a Compiler warning level - all new ---------------------------------- ... ... Any that claims C99 conformance. I haven't used any, so I can't have any preferences. Also note that gcc -std=c99 doesn't solve the C99 library conformance issue by magic. ... I haven't noticed gcc making any progress since 2001. There is precious little evidence that things are going to change any time soon and this is not going to solve the library problem, anyway. ... IMHO, the resources spent on taching C99 would be better used on clarifying the darker aspects of C89. If C99 ever catches on, the... - Wed, Nov 17 2004 7:05 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d7360ceb0613160 Memory Management - all new ---------------------------------- I just wrote an article on Memory Management you all might be interested in. It's based on C, and includes * writing your own memory manager * reference counting * pooled memory * garbage collection The link is: I included a bunch of external references at the end of the article for those interested. Jon - Learn to program using Linux assembly language http://www. cafeshops.com/bartlettpublish.8640017 ... - Wed, Nov 17 2004 6:19 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d16431e95940ab47 RPC program building - all new ---------------------------------- I'm trying to learn how to create an RPC client/server. I'm having problems in understanding how to make it. in particular I'm studying and But I can't understand what to write in the files, and exactly which files I've got to write & which will be generated by rpcgen. I've ready the local version of my program, that uses a function that I've wrote in a separate file. In total so I've three files: -client.c (which will be the client of the application) - sorter.h & sorter.c (which contains the definition e the implementation ... - Wed, Nov 17 2004 9:26 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ab8f7b03ca23987c Gmail invitation - all new ---------------------------------- In article , ... You are invited to gmail all you want. Be my guest. ... - Wed, Nov 17 2004 9:27 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/79bb47615a8071f2 Learning C from old books ?? - all new ---------------------------------- ... While that is true and there are many other good and adequate books available, make it easy...just find and read an ANSI C version of K&R ... - Wed, Nov 17 2004 9:41 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/187ec3296ad0ead9 C socket programming UDP - 3 new ---------------------------------- Hi all, I am trying to learn C socket programming and I have a small program which is a UP client. The problem is, when I run the program, I get a runtime error - "Invalid Argument" - from a call to sendto. I was hoping that if someone has the time they could take a look at my code posted below and let me know what i'm doing wrong? Thanks in advance, Ted /************************* ****** start ... ... struct sockaddr_in * getserveraddr ( char *, char * ) ;/* return server add */ int main( argc, argv ) int argc;... - Wed, Nov 17 2004 10:34 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fb082ab5f282b26c Bitwise idioms - all new ---------------------------------- ... This is a very nicely presented collection. If I may add, there are alternatives to using #defines. One can use const int or enum, ie (building on Mike's summary) const int FOOpos=2; /* pos shorthand for position */ /* const int FOO = (1U<1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a3e4be9ced83cea7 qsort - 4 new ---------------------------------- I'm trying to figure out qsort(). I haven't seen any practical examples, only synopsis. In the code below, the array is not sorted. Can someone give me some help? ... int main(void) { ... int compare(const void* a, const void* b) { ...... - Wed, Nov 17 2004 11:14 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2329e52e47f51f82 C... Why not c++? - all new ---------------------------------- ... I code my own programs for my work (I'm a physicist) and I never felt the need to use C++. With C, I just get the job done. ... - Wed, Nov 17 2004 11:28 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/729e593ab5747942 Stuck with a strange core (C code) -- Please help. - 2 new ---------------------------------- I think the problem is found: there is a function, which is a couple of layers down from rrr_resend_packet(), got something like a[i]++ with a[] defined as local and i uninitialized. This cause it radmomly pick up a place ( in stack) and increment it. Geez, I hope there is a better systematic way to catch memory violation like this. Thanks everyone for your help. -SZ ... - Wed, Nov 17 2004 11:39 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40901c21e3f7e563 COMP3 Packed Decimals - all new ---------------------------------- ... It's not really a C programming question, as stated. A C programming question would be something like: Here's a data format, packed decimal, as defined by the COBOL COMP-3 data type. I need to convert some integers in string representation [are they actually in ASCII, or are they in the implementation character set, which might or might not be ASCII?] into this form. What's a good way to do that in C? You still might have been pointed to comp.programming on the grounds that this is as much an algorithm question as... - Wed, Nov 17 2004 12:48 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7cc0d788ae29187 getting variable type in C - all new ---------------------------------- ... Agreed, but still I prefer passing the type rather than an object. Here's why: Some algorithms might require more than one temp object. Having to pass different number of temp arguments to different macros would be clumsy. Passing the type I gain *uniform interface*. When changing the algorithm, the new one could require more temp objects; in this case I would have to change number of parameters and subsequently change all macro calls. When I pass the type, macro expansion can generate as many local... - Wed, Nov 17 2004 2: 26 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3c5bebf4c0625e0b strlen in a for loop with malloc-ed char* - all new ---------------------------------- In article <news:[EMAIL PROTECTED]> ... It is "done and portable" under particular conditions. As a general rule, it is a bad idea in the first place -- instead of re-using the "standard" name (like strlen or fprintf), *change the name* when you change the meaning. A function named "my_ strlen" or "my_fprintf" tells someone reading and maintaining the code that this is *not* the C Standard Library version of strlen() or fprintf().... - Wed, Nov 17 2004 2:57 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/eb0a87eda9aa95e6 Quiting a program using pure C - all new ---------------------------------- [Specific to C99] ... Since I still have not actually bought the final PDF, I will believe you; but: ... I remember discussion (from before the C99 standard was final, I think) about this. The claim was that: a) assigning a bool variable from a pointer was allowed; b) the result of such an assignment was "true" if the pointer compares unequal to NULL and false if it compares equal -- e.g.: ... would always "mean the same thing" as: ... and therefore c) by making assert "look like" a function taking a single " bool",... - Wed, Nov 17 2004 3:19 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/64c944589e3ebd58 C Web crawler code - 2 new ---------------------------------- Hi All, I am looking for a simple C/ C++ web crawler code. It should be very simple with minimal functionality. I am particularly interested in the code to grab the content of a url and the code to search this content for other urls. Thanks. ... - Wed, Nov 17 2004 4:01 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c70e9afbee832177 Learning C - 2 new ---------------------------------- Hello, I am trying to learn C from the book "C By Example". The first example in the book is: /* Filename: C2FIRST.C Requests a name, prints the name 5 times, and rings a bell */ ... main() { ... The program compiles with no errors. During execution the name repeats 5 times but there is no BELL sound. Was this program possibly NOT meant to run on a PC? The book is from 1994. I am using Windows ME (yuck) Thank you ... - Wed, Nov 17 2004 5:34 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7c3b9722743bd9e Simple vsscanf source code - 3 new ---------------------------------- ... Well no surprise! vsscanf() is one of the most complex functions you can find in the C library. Its semantics are contorted and extensive and there are a lot of small details to take care of, especially with portability as a constraint. What kind of extensions are you looking to add ? What features are you willing to remove to get a simpler version ? You can try to find Plauger's implementation from his book "The Standard C Library". An older version would be a better start. Chqrlie.... - Wed, Nov 17 2004 7:40 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a30eda8520eca98b Learning C with Older books ?. - 4 new ---------------------------------- ... The book from 1988 might be a bit out-dated, unless it is a very high- quality book, like the second edition of "The C Programming Language". The other books will do fine date-wise, but be warned that there are a lot of bad books in circulation, regardless of when they were printed. If you want to know if your books are any good, check if you can find a review for them at http://www.accu.org/ or ask us (please tell us the title, author(s) _and_ version of each book). Bart v Ingen Schenau... - Wed, Nov 17 2004 7:49 pm 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/66bc74d8d8d22b33 extern with incomplete types - all new ---------------------------------- Given this code appearing in this order in one file: typedef struct tag type; extern type var; struct tag { int i; }; I have some compilers that give an error on the "extern" declaration, complaining that "tag" is incomplete or undefined, while some compilers accept this code. Which is the correct behavior? ... - Wed, Nov 17 2004 9:39 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b6df4e38e8d2c453 assembly to C / C++ / VC++ conversion tool !!! - all new ---------------------------------- Hi , kindly tell me a good assembly to c/c++ conversion tool. tonnes of thanx in advance, karthik bala guru ... - Wed, Nov 17 2004 10:31 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/18cfc37930ddf4a6 Can I write spyware, spambots and worms in C ? ? ? - 4 new ---------------------------------- I must write them to annoy some assholes.Is it possible in C or is BASIC the better choice? ... - Wed, Nov 17 2004 11:19 pm 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c94dc27dfb2c6709 ======================================================================= 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
