comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * ++i vs i++ - 16 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5185f19742e42067 * union access - 13 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ae5339a09d904e21 * struct and union alignment - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9bd6e74130b2c03c * envp[i]!=(char *)0 - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6ec9703774acfcb3 * Newbie-question: scanf alternatives? - 10 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7a737a53f44215a6 Active Topics ============= union access - 13 new ---------------------------------- ... Just because there's an important difference doesn't make them "completely different". If structures and unions are "completely different", what are you left with to express, say, the difference between ints and structures? Unions and functions? Types and statements? ... I don't weight the presence or absence of iteration as highly as you do, and I rate the similarity of treatment of subcomponents more than you do. Why is why I pointed out you could improve your argument by picking `switch` instead of `if`.... - Thurs, Sep 23 2004 1:29 am 13 messages, 9 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ae5339a09d904e21 > > > > mothafuckas matt parker alias e_von_lunsen_hout matt parker alias erik_ vonlindtherzog matt parker alias erik van lint herzog matt parker alias sex machines matt parker alias taniadchenka matt parker alias fquisinsky matt parker alias n_za - all new ---------------------------------- comp.lang.c,soc.culture.cambodia,sci.chem.analytical,comp.unix.cde,comp. publish.prepress ... parker alias matt parker matt parker alias evanlunsen matt parker alias erik von lunsenhout matt parker alias kim parker bitchers matt parker alias evon_lunsen_herzog matt parker alias erikvan_lindt fetish matt parker alias ericparker appeal to do physical material ... eric_vonlindt_ hout matt parker alias k_parker sex matt parker alias gerald_jones his true name is matt parker from cottage grove oregon and that is final matt parker alias... - Thurs, Sep 23 2004 2:49 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3c76c1d6a07ba2b great - 2 new ---------------------------------- Groovy hepcat merman was jivin' on Tue, 21 Sep 2004 13:09:48 +0200 in comp. lang.c. great's a cool scene! Dig it! ... To whom, for what? You failed to quote what you were responding to, and began a new thread, so noone has the foggiest idea what this is about. Don't do that. If you absolutely must thank someone here in the newsgroup, do so in the thread in which you were helped, and quote the text to which you are responding (at least enough to give us some context). ... - Thurs, Sep 23 2004 3:16 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ba89d48bd55cc38a ++i vs i++ - 16 new ---------------------------------- Hi All, I would like to know when ++i should be used instead of i++ and vice versa. Some code examples would be of help. Does it really matter for assignments? Thanks, Arut ... - Thurs, Sep 23 2004 4:30 am 16 messages, 14 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5185f19742e42067 C language portability support - 4 new ---------------------------------- Hi All, Like typdef, does C have further support for portability? Thanks, ASM ... - Thurs, Sep 23 2004 4:33 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/21c5964353b00772 c-book - all new ---------------------------------- Thanks for answers. Good to know. o-o Thomas ... - Thurs, Sep 23 2004 5: 20 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fd1e4c3319421eee calling fopen using function - 7 new ---------------------------------- Hello there Parameters in C are always by value, never by reference. the error is in the void open_file(FILE *fptr_tmp, char *fname_tmp) fptr_tmp is a local var. its changed but the calling function don't get it's new value, the pointer to the opened file. use void open_file(FILE **fptr_tmp, char * fname_tmp) { *fptr_tmp = fopen(fname_tmp,"r") ; if (*fptr_tmp == NULL) { ... and call it like this open_file(&fptr, fname) ; now you have a working program again! Greetings Olaf ...... - Thurs, Sep 23 2004 5:39 am 7 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/69fdf19057fd0291 Newbie-question: scanf alternatives? - 10 new ---------------------------------- ... They are also known to be non-conforming to the C standard specification, which requires sticky eof. ... This assumption is foolish, even if it costs you nothing. ... Yup, redesign the interface of your function, so that it can signal the EOF condition to its caller. A well designed fgets-like function returns a structure containing a pointer to the line and an exit status flag. This way, you can *reliably* take care of those non-conforming systems you're talking about. Dan... - Thurs, Sep 23 2004 5:35 am 10 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7a737a53f44215a6 Q: volatile struct elements or entire struct? - 2 new ---------------------------------- Chris Torek wrote in news:[EMAIL PROTECTED]: ... Excellent. ... Oh it does, this has been heavily verified. Cross-compilers tend to this as one my hope for. Thanks Chirs. ... - Thurs, Sep 23 2004 5:50 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c4e2145f60d8146c Pop's Device, was Re: Some Newb Problem with "int", please help. - 5 new ---------------------------------- ... ... How can you do *anything* reasonable once undefined behaviour has been invoked (by opening the file in the wrong mode)? ... As I already said in the text you've snipped, it is the user's job to properly import the text file on the system he wants to process it. This way, there is no undefined behaviour and the program need not try to do a job it cannot be reliably done. Last time I checked, file transfer protocols had a text mode that did the right thing when dealing with text files, including character set... - Thurs, Sep 23 2004 5:52 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/68cb42fb87cea0db mysql problem - 4 new ---------------------------------- Hello everybody I got a strange problem when retrieving data from a sql query. I have a function that queries the database, gets data and store that in a struct. I hope ist ok to post all the code: ADINFO getRefPhone(char * ref){ .. . Everything works ok until I do res = mysql_store_result(conn); if (res) Thus, res becomes null. Why? The connection is ok. The query ( I printed it and it looks ok) too. The char *ref contains the right value. I tried to print it put. eg. I got the value 1010. I checked in the database and... - Thurs, Sep 23 2004 6:17 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40f325c663252db Daylight saving - all new ---------------------------------- ... Hmmm... I don't think that argument will stand up in court in the UK... It might in the Netherlands, at least if you'd made the copy yourself, but I don't think "backup copy" falls under fair use in your country. Of course, you're not likely to get into trouble unless you sell them on. Richard ... - Thurs, Sep 23 2004 6:39 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a8f351326d6538ab elementary construction follow-up - 4 new ---------------------------------- ... Only if you use a broken compiler. ... fangorn:~/tmp 218> gcc test.c test.c: In function `main': test.c:3: error: parameter name omitted ... The *initial* call of main(), that comes from outside your C code is special. It must work no matter which of the two supported definitions of main is used and, if main() returns, the program termination sequence must be initiated. If the program calls main() itself, these calls are perfectly ordinary: they must match the actual definition of main() and... - Thurs, Sep 23 2004 6: 21 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/eddddaac4ec842ce Managing global vars between files - 4 new ---------------------------------- ... You have just discovered one of the main reasons for using header files. Put all the extern *declarations* in a header file that is included by all the other source files. Put the corresponding *definitions* only in one source file (not all of them need to be in the same source file, but none of them should be in more than one source file). This way, adding or removing one global only requires changes in two files, which is a lot more manageable than changing all the source files of the application.... - Thurs, Sep 23 2004 6:32 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/34560407c855474b need help creating a tree of processes(implemented in C) - 4 new ---------------------------------- I want to create a tree of processes. The depth of the tree is given by the variable depth and the number of processes started by each node is given by the variable numberOfProcesses. Is the following code correct? I don't think it is, especially since I don't want the bottom nodes(leaf nodes) to start any processes themselves. Any comments on the following code would be much appreciated!! ...... - Thurs, Sep 23 2004 7:02 am 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8d063326bfc675e5 Pointer question [ Newbie ] - 5 new ---------------------------------- Hi, If I declare a pointer to an integer like this int *intPtr; what would & intPtr return? Thanks, Andre ... - Thurs, Sep 23 2004 10:53 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/bb7fd15e5833bc3b struct and union alignment - 12 new ---------------------------------- I would like to check if I understand the following excerpt correctly: 6.2.5# 26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Does it mean that *all* structure (or union) types have the same alignment? Eg. type struct { char c; } and struct { long double ldt[11]; } have the same alignment requirements? If the answer to the above is "yes", then it... - Thurs, Sep 23 2004 12:10 pm 12 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9bd6e74130b2c03c Screen Handling - 2 new ---------------------------------- "Curious Student" wrote ... You receive characters from stdin, and send characters to stdout. If you want to clear the screen, print green text, suppress echoing to input a password, you must use a platform-specific library. ... - Thurs, Sep 23 2004 12:20 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c19742be19369d91 envp[i]!=(char *)0 - 12 new ---------------------------------- I was just reading about the envp argument for main function. Since there is no argc equivalent for envp (i.e the number of elements for the envp array are not known) the last element will be a null pointer. But my question is about the syntax used to test this: envp[i]!=(char *)0 [This generally appears in a for, something like for(i=0;envp[i]!=(char *)0;i++)] What exactly does ( char *)0 stand for? Is it a test for null pointer? Can we use nul for the same as in: for(i=0; envp[i]!=nul;i++) Hope to hear from someone. Thanks.... - Thurs, Sep 23 2004 12:26 pm 12 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6ec9703774acfcb3 Malloc/Free - freeing memory allocated by malloc - all new ---------------------------------- ... runs on, trying even to not let the OS to put its data on the swap, and not all OSes must do it, if all do, better. And I agree with Michael Wojcik that here is not the place for this discussion. ... - Thurs, Sep 23 2004 1:38 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c1d9f42a01aa0d5d Invoking A DOS Program Through A "C" Program - 2 new ---------------------------------- hello I'm fairly new to the language, and my problem is I'm trying to write a program to run a command from the DOS prompt "C:>". I don't know all the functions in "C", however there are a few under the header file "process.h" that could be used, but I'm not really sure what they mean. I only know them by their name . I don't understand the arguments that are passed down to these functions, is why I'm seeking help to write this small program. Functions like: "spawnl", "spawnle", "spawnlvpe" or "execl" to make a... - Thurs, Sep 23 2004 2:25 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ee48c3ae9265f0d2 C Program Portability - all new ---------------------------------- On Thu, 23 Sep 2004 00:39:48 -0400 (EDT) ... I was thinking more of a 16 bit byte. Imagine this, you write your file out on the 16 bit byte machine then transfer it to an 8 bit byte machine. Now, since this is a binary file, any transfer is likely to convert every 16 bit byte in to *two* 8 bit bytes, since to do otherwise looses information. Then you have problems reading it! Hence the comment I should have made (but may have forgotten to make) that any code writing data as a binary file needs to be adapted for the... - Thurs, Sep 23 2004 2:18 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d51ca9bdab86106c newbie-question: comments - all new ---------------------------------- On 23 Sep 2004 08:21:34 +0300 ... <snip> ... Depending on what you are doing and whether you might want to disable the code again you can just replace "#if 0" with "#if 1" to switch the code block back on. I'm sure you (Giorgos) know this, the comment is more for the OP.... - Thurs, Sep 23 2004 2:34 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3f86f8e58946e4ac Max Path [Newbie] - 6 new ---------------------------------- I was just wondering whether there is any MAX_PATH macro in C\C++? If not what is a safe value to assume for maximum path length? ... - Thurs, Sep 23 2004 8:49 pm 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c9baf271210d161a 6 byte integer to string - 2 new ---------------------------------- HI, I face the task of converting a 6 byte integer (MSB first) to a decimal string. The platform I use supports only 4 byte basic data type. I have written some algorithms that loops to many times :-(. It would be great help if any of you can share a high performance algorithm to do this. Thanks Sudi . .. - Thurs, Sep 23 2004 10:07 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b807abc621be51e5 ======================================================================= 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
