comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Tips on gaining proficiency in C - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9d4264dd7b9939f9 * free() dumps core with a segfault. - 11 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/69917295e9776154 * Question about declaring Floating Point Variable in a Structure - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1d194f8f143793f5 * union access - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ae5339a09d904e21 * string & bytes - 5 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c28d3d26a0a9eaee Active Topics ============= free() dumps core with a segfault. - 11 new ---------------------------------- ... ... That doesn't look unreasonable. But since your already printing out the addresses of the nodes on malloc()ing them it probably will be interesting to see the addresses before you call free() on them. I would guess that there will be a surprise for you, i.e. that the addresses won't be identical to the ones you got from malloc(), meaning that somewhere in your program you have inadvertently over- written one of the next pointers. Where that happens is impossible... - Wed, Sep 15 2004 1:22 am 11 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/69917295e9776154 Does typecasting consume cpu cycles - 3 new ---------------------------------- ... And conversion overhead (which may be zero). ... The cast causes the same conversion as happens before the assignment to var above. A good compiler will probably generate identical code in both of your cases. Even if it does not, the difference will be (a) due to the assignment rather than the conversion (the latter happens in both cases), and (b) probably very, very small anyway. Do whatever makes the code easier to read, which I suggest is case 1. Alex ... - Wed, Sep 15 2004 1:55 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/af94b8ec8a17687d Tips on gaining proficiency in C - 12 new ---------------------------------- Hi, Regret the fact that this post may be slightly OT to c.l.c, but I am sure that people there would give GREAT advice... I am working as a QA (Automation) , which generally involves writing mundane Perl scripts for automated testing of a C Utility. Bored with the kind of work I am doing, I would love to learn C Programming (I have theoretical knowledge, thanks to a Bachelor's in CS), with the intention of, to start with, learning enough to enable me dabble in systems programming (Linux/Unix) (and hopefully, a... - Wed, Sep 15 2004 2:02 am 12 messages, 10 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9d4264dd7b9939f9 Timer in a C Program [OT] Answer - 3 new ---------------------------------- ... I think it's easier to use the alarm function (it is just for timeouts): man alarm ... - Tues, Sep 14 2004 3:24 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d7599d52aadb2149 StarBurn SDK 4.1.0 released. - all new ---------------------------------- For Immediate Release Rocket Division Software [EMAIL PROTECTED] STARBURN SDK VERSION 4.1.0 ADDS CD-TEXT SUPPORT AND COMES WITH THE MOST COMPLETE FEATURE LIST ON THE BURNING SDK MARKET. Rocket Division Software had announced immediate availability of the version 4.1.0 of its StarBurn burning SDK. The new version introduces full CD-TEXT support for any Disc-At-Once mode compatible device as well as adds full OGG Vorbis support so that now SDK supports all available today makes the StarBurn SDK objectively the most complete... - Wed, Sep 15 2004 2:28 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4281caf41e9433f0 LINKER/LOADER DOUBT - 2 new ---------------------------------- ... And then you are unfortunately wrong here. Linking, loading and processes are things that are outside the realm of C. Typically, they are rather system specific (but more or less independent of the language the progam was written in), so your best bet is to ask in a group that deals with the details of the system you are using.... - Wed, Sep 15 2004 2:29 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/72e51c2673fa1aca Gmail invitation - all new ---------------------------------- Meher scribbled the following on comp.lang.c: ... Your question is off-topic on comp.lang.c and comp.lang.c++. I suggest you ask in a Google-specific newsgroup for further help. ... - Wed, Sep 15 2004 2:42 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/79bb47615a8071f2 comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) - all new ---------------------------------- Archive-name: C-faq/abridged Comp-lang-c-archive-name: C-FAQ-list.abridged [ Last modified July 3, 2004 by scs.] This article is Copyright 1990-2004 by Steve Summit. Content from the book _C Programming FAQs: Frequently Asked Questions_ is made available here by permission of the author and the publisher as a service to the community. It is intended to complement the use of the published text and is protected by international copyright laws. The on-line content may be accessed freely for personal use but... - Wed, Sep 15 2004 3:00 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/78963a3ff601d90c Performance Programming - 2 new ---------------------------------- ... Yep - it's called the Java Native Interface (JNI), and it provides a framework to call libraries written in other languages (although usually C, as this is what it is geared towards). I've always found it works pretty well, and it even allows two-way communication between the Java and C code. Bit off- topic I suppose, but perhaps the OP could just use C for the parts that are too slow. Having said that, I think 99% of the time your algorithms are the place to invest the effort. Java isn't THAT slow! <SNIP>... - Wed, Sep 15 2004 3:51 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/bccd33b9dff2397f malloc and free - 2 new ---------------------------------- ... ... unless you pronouce it "throatwobbler mangrove". ... - Wed, Sep 15 2004 4:35 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9dc6bf671c014afb Question about declaring Floating Point Variable in a Structure - 6 new ---------------------------------- Dear Sir, I am a newbie in C. I am trying to run the following code. main() { struct emp { float sal; ... scanf("%f",&empl.sal); printf("%f",empl.sal); ... This program compiles fine but at run time I get error. I am using Borland C on windows. IF any one has got similar problem and knows a fix, please help me. Kind Regards, Nasir Khan ... - Wed, Sep 15 2004 5:31 am 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1d194f8f143793f5 union access - 6 new ---------------------------------- ... Regarding unions and their usefulness, can anyone point out UB in the following code? It tries to stack up "local" variables in an array of char intended to be used by a call hierarchy of statemachines. To save memory, only the actually needed local variables are allocated, although the enclosing union is larger. How bad is this with regard to the standard? ... enum fsm_ state { IDLE, LOAD, STORE, SEARCH }; struct fsm_common{ enum fsm_state State; } ; struct fsm_type1{ enum fsm_state State; int Length; long Addr; };... - Wed, Sep 15 2004 5:44 am 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ae5339a09d904e21 string & bytes - 5 new ---------------------------------- Hello I have: struct packet{ byte type; /*my byte is unsigned char*/ int len; . .. p->type=10; p->len=0; std::string str=""; for (int i=0; i<5; i++) str[i]=* ((byte*)p+i); i want to create std::string object which has bytes from p. ( because that string object is later used for Sending() that packet). My problem is that: when before sending i displayed str some character values were less than 0 (thru to char instead of unsigned char). How can i prevent it ? Second problem is strange. When i displayes str i received:... - Wed, Sep 15 2004 7:13 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c28d3d26a0a9eaee Wide string initializer syntax - 2 new ---------------------------------- ... Ah, you're right. It was the first one I was unsure of, but: "An array of character type may be initialized by a character string literal, optionally enclosed in braces." "An array with element type compatible with wchar_t may be initialized by a wide string literal, optionally enclosed in braces." - C 90, 6.5.7 I can't figure out what these optional braces are for. I suppose yet another concession to existing implementations.... - Wed, Sep 15 2004 7:32 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2cdb63f40db2686f Link compatibility among C compilers? - all new ---------------------------------- ... ... Although C++ has the additional problem of no existing standards for name mangling, I have no problems mixing g++ and icc on Linux: fangorn:~/ tmp 151> cat gcc.cc void icc(char *); int main() { ... fangorn:~/tmp 153> cat icc.cc ... void icc(char *p) { ... fangorn:~ /tmp 155> icc icc.o gcc.o fangorn:~/tmp 156> ./a.out Hello world fangorn:~/tmp 157> g++ icc.o gcc.o fangorn:~/tmp 158> ./a.out Hello world Dan... - Wed, Sep 15 2004 10:21 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ab0aed3fc58b6cd9 "does not give a valid preprocessing token"... Why? - 4 new ---------------------------------- Hi All, I have a piece of code (not written by me) that is failing on compile with the error: pasting "xdr_ndmp_connect_open_request" and "," does not give a valid preprocessing token The relevant line from the header is: ... Any and all help greatly appreciated. ... - Wed, Sep 15 2004 10:57 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7883ec1e7fd0e655 Warnings when using % operator - 5 new ---------------------------------- Below is some sample code to illustrate two warnings I get using a Hitachi compiler. When I use the GCC compiler I get a clean compile. I'd be grateful if someone could explain what the warnings actually mean as they are rather crytic, to me anyway. When I change the type of LOOKUP_MAX from size_t to int, I get a clean compile in the Hitachi compiler. ... /* macro for portable modulo operations */ ... char *lookup[] = { "ABC", "DEF", "GHI", " JKL" ... const size_t LOOKUP_MAX = NELEMENTS(lookup); ...... - Wed, Sep 15 2004 11:06 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/74be46f68898cb9f [OT?] What is (a) "plunger"? - 2 new ---------------------------------- ... Thanks for responding, sir! I suspect the 'n' was the speaker's nasality, so not quite that much of a stretch. Do I infer correctly that the 'g' is soft? Thanks again, rjt... - Wed, Sep 15 2004 12:59 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a10a1f005c8f5002 no lcm in standard library? - 2 new ---------------------------------- ... Whether that's good depends on how many gcds you need to calculate :-) But there doesn't seem to be much difference. On my 700MHz imac, an obvious implementation of Euler's algorithm takes 1.1uS for the above numbers, and the binary algorithm takes 0.8uS. -- Richard ... - Wed, Sep 15 2004 2:58 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e55b228d2e9561d5 New Annotations - 2 new ---------------------------------- It occurred to me that, although we all know Schildt's commentary on the ANSI C standard is useless, perhaps a free document much like it could be made by the community. Contributors could make corrections to the inevitable errors and confusing statements that would arise. While it's quite useless without the standard itself, it could be read along with it, as well as link (or even show in a frame alongside it) corresponding portions of the Draft and Rationale. What do you guys think of this idea?... - Wed, Sep 15 2004 5: 43 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/50abf31cb0570236 C external execution - trap stdout + stderr - 2 new ---------------------------------- Hi, using popen() doesn't seem to give me any way to capture the stderr of the child process. does anyone know whether there is any way to capture these: 1. stdout 2. stderr 3. exitcode and return to the calling C program after execution? you can assume a Linux or Unix like system. any response or insight would be appreciated. Thanks. chok ... - Wed, Sep 15 2004 8:26 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e28beb0f659cdffe #ifdef - 2 new ---------------------------------- I have a small doubt, ... else? If the definition is somewhere where can i find the defnitions ? ... - Wed, Sep 15 2004 9:27 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3bd78f7e89e53da8 speed of int vs bool for large matrix - all new ---------------------------------- ... Warshall's algorithm is the wrong tool to use on large graphs. Combinatorial creatures get too big, too quick. If you managed to contort this problem, squeezing an int into a bit and actually pulling it off in main memory, then next week your prof will ask you to solve it for a graph with ten times the number of vertices. I saw nothing about this problem that would not lend itself to breaking it up into reasonable-sized chunks and serializing. Of course, you're unlikely to find somebody else's well-known algorithm to do that. I prefer... - Wed, Sep 15 2004 10:19 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cb38beb7c98d9c19 Floating point number to binary - all new ---------------------------------- Hi, I want to convert a floating point number (or a decimal number say 123. 456) into binary notation using a C program. Can somebody help me out with it? Thanks Gaurav... - Wed, Sep 15 2004 11:32 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e706d56b01a84359 Two Questions about "strlen", "strcat" and "strcpy" - all new ---------------------------------- ... You have a very good point here. The obvious but simplistic reason is that negative string lengths are meaningless. But then wouldn't it make sense for strlen(NULL) to be -1 ? With the current C spec, it is undefined behaviour, and most implementations will crash... The decent but somewhat optimistic explanation is that it allows for strings to be as large as the largest object (size_t). But I have seen implementations where the largest objects were larger than size_t could handle, and strings were still limited to... - Wed, Sep 15 2004 11:32 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e9ba0a3a9129c3ba Need help on bit operations define - all new ---------------------------------- ... This is not correct : shifting right 3 bits and dividing by 8 are not necessarily equivalent : because C99 doesn't preclude binary arithmetic (a pedantic argument, with no real modern examples) and more importantly because they produce different results for negative numbers ! -1 >> 3 is -1 -1 / 8 is 0 -1 & 7 is 7 -1 % 8 is -1 Of course this macro should only be used with positive numbers, but if the pos argument is a signed int variable expression, the compiler cannot assume its value to be positive, and will generate... - Wed, Sep 15 2004 11:31 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7b491449ae29143d ======================================================================= 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 ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/BCfwlB/TM --------------------------------------------------------------------~-> <a href=http://English-12948197573.SpamPoison.com>Fight Spam! Click Here!</a> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/kumpulan/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
