comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * struct and union alignment - 10 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9bd6e74130b2c03c * contiguity of arrays - 8 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/367141614adee786 * Rectangle intersection - 7 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/df46e4a94fe7eb55 * integer to char table problems - 7 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f9b7bd3a6315721c * Disadvantage of using 'inline' - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d87eaccd3d3874ba Active Topics ============= ++i vs i++ - 4 new ---------------------------------- "John Bode" wrote added by Malcolm int stack[STACK_SIZE]; int sp; ... posted a fragment, it isn't technically an error. Your example shows UB when sp equals STACK_SIZE -1. As I said, use of pre-increment can be confusing. . .. - Sat, Sep 25 2004 1:02 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5185f19742e42067 electronic component connection routing - all new ---------------------------------- "Krishna Sagiraju" wrote ... off-topic here. Try comp.programming for a discussion of routing algorithms. ... - Sat, Sep 25 2004 1:13 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5b23d7948e6d67c4 Calling fortran subroutine from c - all new ---------------------------------- (apologies for the late reply - catching up) ... Google for "cfortran.h" It is, of course, almost entirely in the realms of Undefined, Unspecified, and Implementation-defined Behaviour, but may just solve your problem. It (well, the version extant at the time) worked for me under VMS in 1990 or thereabouts. mlp ... - Sat, Sep 25 2004 1:12 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b272d3ce87c41be1 Clearly, it is too late to fix c99 - C is dead - 3 new ---------------------------------- In order to kill C, you would antecendently have to kill me, which is not so easily done. If c99 falls flat, there will be a c2006 oder something similar. Lack of standards makes everyone pull their hair out. It borders on language- bashing for me to ask: if not C, then what? MPJ ... - Sat, Sep 25 2004 1:45 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2294ba70f0949aae Disadvantage of using 'inline' - 6 new ---------------------------------- ... A larger executable may mean less efficient usage of the processor cache, but it may not. As an obvious example, judicious loop unrolling (by the compiler) often causes larger code, but faster code. Of course, everything in moderation: if you unroll too much you will cause icache (or trace cache) thrashing because your working sets keep pushing each other out. That's really the essence of what Dan was getting at. As usual, there's a bunch of competing factors. Inlining small, frequently *called* functions may be... - Sat, Sep 25 2004 1:53 am 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d87eaccd3d3874ba envp[i]!=(char *)0 - all new ---------------------------------- ... Quoth the C99 standard: 6.3.2.3 Pointers [...] 3. An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.48) If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal to a pointer to any object or function. Mark F. Haigh [EMAIL PROTECTED] ... - Sat, Sep 25 2004 2:06 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6ec9703774acfcb3 C language portability support - 6 new ---------------------------------- ... Are you being deliberately obtuse? Whether it has anything to do with portability "per se", it's widely used to aid portability. The current C standard even explicitly uses it for that purpose: 7.18.1.1 Exact-width integer types 1 The typedef name intN_t designates a signed integer type with ... 2 The typedef name uintN_t designates an unsigned integer type ... What's your point? C can be used to write portable programs that can run on anything from the largest supercomputers to tiny microcontrollers. It can also be used to... - Sat, Sep 25 2004 2:43 am 6 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/21c5964353b00772 struct and union alignment - 10 new ---------------------------------- ... Correct. <snip> ... No, that will not cause any problems. Many implementations do this, including the one I'm typing this response from. < snip> ... Right. It's an ABI issue, and many compilers have command line switches that determine which ABI they target. A quick example: -malign- double -mno-align-double Control whether GCC aligns double, long double, and long long variables on a two word boundary or a one word boundary. Aligning double variables on a two word boundary will produce code that... - Sat, Sep 25 2004 3:14 am 10 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9bd6e74130b2c03c end thread - all new ---------------------------------- ... You don't seem to be the one donating your time to answer people's questions, do you? You seem to be one of the people asking them. So how about you worry about you, and we'll worry about ourselves. We'll discuss it until we feel like stopping. When everybody stops, the thread will die. You haven't been around Usenet very long, have you? Mark F. Haigh mfhaigh@ sbcglobal.net ... - Sat, Sep 25 2004 3:19 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/eddddaac4ec842ce Beta testers needed - C to Java byte-code compiler/IDE - all new ---------------------------------- Can we have details on what subset of c89 you've implemented? I wrote a jvm backend for GCC back in '98 and the result was extremely poor performance of output. The big problems if I remember correctly were: ... unsigned 32 bit types to signed 64 bit ones to get anywhere) ... optimised for this. Of course, if you're changing the JVM in any way or making your own JIT that is closely tied to patterns in your code generation then you're just cheating :) . .. - Sat, Sep 25 2004 3:27 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/356fa865148069dc Invoking A DOS Program Through A "C" Program - 4 new ---------------------------------- ... Keep learning, you'll get the hang of it. You may want to find a MSDOS newsgroup like comp.os.msdos.programmer. ... Try the following program. The system() function is the only thing standard C has to say about this kind of thing. ... int main(void) { system("cls"); return 0; ... Does your screen clear when you run it? If so, simply replace "cls" with the command you'd like to run. Mark F. Haigh [EMAIL PROTECTED] ... - Sat, Sep 25 2004 3:27 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ee48c3ae9265f0d2 contiguity of arrays - 8 new ---------------------------------- ... Yes it is legal and will print 4. This array describes a contiguously allocated nonempty set of objects of type int. b = a[0] positions the int *b to the beginning of the array object as would b = &a[0][0]. ... int main(void) { int a[2][2] = {{1, 2}, {3, 4}}, *b = a[0]; printf("a[2][2] = ((1,2} ,{3,4}};\nint *b;\n" ... printf("Using b = &a[0][0]. *(b + 3) = %d\n",*(b+ 3)); printf("The pointer values &a[0][0] and a[0] are%sequal\n", (&a[0][ 0] == a[0])?" ":" not "); return 0; ... ... - Sat, Sep 25 2004 3:30 am 8 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/367141614adee786 Managing global vars between files - 2 new ---------------------------------- "Keith Thompson" wrote ... always exceptions. What you probably want to do is to declare a few variables g_temp1, g_temp2 etc, with the understanding that their value may be corrupted by a subroutine. Leaf routines can use these variables at will, non-leaf if they do so carefully. That way your precious memory space is reused. ... - Sat, Sep 25 2004 4:38 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/34560407c855474b elementary construction +1 - 4 new ---------------------------------- Hi there, ... Byte: sizeof orange, sizeof *apple (if you meant apple itself, which equivalently could be declared as a char **, sizeof apple) Bit: the above times CHAR_BIT, from Range: INT_MIN <= orange <= INT_MAX; for pointers, there is no general pointer range but you are guaranteed a valid range within your object (that is, apple[0] through apple[orange-1]) ... You are maybe not aware of it but there are translations of K&R to other languages. For these, the page numbers are not the same. Apart from... - Sat, Sep 25 2004 4:41 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/54b4e75539eebe6d Rectangle intersection - 7 new ---------------------------------- hi all, how to calculate the intersection of 2 rectangle a rectangle is the following: Rectangle makeRectangle (Point lowerLeft, Point upperRight) { Rectangle r; r.pt1 = lowerLeft; r.pt2 = upperRight; return r; ... and Point is the following: Point makePoint(int x, int y) { Point p; p.x = x; p.y = y; return p; ... And i want the know how to make: Rectangle intersection(Rectangle r1, Rectangle r2) this should return the intersection of the 2 rectangles anyone can help me plz? ... - Sat, Sep 25 2004 8:16 am 7 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/df46e4a94fe7eb55 Tips on gaining proficiency in C - all new ---------------------------------- ... I agree with Richard. Grab any book you can (all the previously listed ones are great), copy the examples, play with them, break them and fix them, do some of the exercises. Take a program from a code bank and run it -- a lot of times there will be bugs. Debugging is educational and fun in and of itself. Write something that _you_ think is useful and gives you enjoyment. As for sourceforge, even projects where the required skill level is novice often are a lot more complex than a beginner needs to get... - Sat, Sep 25 2004 9:48 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9d4264dd7b9939f9 How can I use socket.h? - 2 new ---------------------------------- Hello everyone. I am a beginner in network programming and when I try to compile a source using the Dev-C++ in the Windows XP there is wrong message telling me cannot find "socket.h" and there do not exist thes file on my PC. Where can I download it to make my code work or are there any other method to solve this problem? Thanks! ... - Sat, Sep 25 2004 9:49 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/385c7578089fb3eb integer to char table problems - 7 new ---------------------------------- I am trying to print a table of what integer corresponds to what character. Can someone please tell me what is wrong with this code? ... int main() { char line[9]; /* each word in the wordlist */ char d; for (d=0; d<=255; d++) ... Thanks in advance! ... - Sat, Sep 25 2004 2:23 pm 7 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f9b7bd3a6315721c cmsg cancel <[EMAIL PROTECTED]> - all new ---------------------------------- Article cancelled by author. ... - Sat, Sep 25 2004 4:03 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b050eba3e71441b0 Isn't C Programming In DOS, A Part Of This Newsgroup? - 3 new ---------------------------------- Hello I was asked to try another group in an earlier post, I was writing the program in C inside a DOS window. Software of choice -> (Borland Turbo C++ 1.0) . Nobody uses DOS anymore?...I'm I the only one? Dos is not the issue! It's weather or not C programming is still excepted by users writing programs for the DOS operating system...........some people don't agree. This is lang.C ... .....right? Where does it say you have to program in Windows or DOS for that matter? People seem to forget where it evolved from,... - Sat, Sep 25 2004 5:04 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/49d09a4a5ce35c43 strstr(char *str1, char *str2) - all new ---------------------------------- ... different than the snippet you posted? I.e. was it originally: if( endOfResponse = NULL) { // note single quote Cordially, Neil ... - Sat, Sep 25 2004 5:07 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b4f2749599e22f96 Cmsg cancel <[EMAIL PROTECTED]> - all new ---------------------------------- was cancelled from within trn.... - Sat, Sep 25 2004 5:39 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/156047c08260d7d7 Variable Sized Struct Members? - 2 new ---------------------------------- My understanding is that struct members will remain in order such that the following can be used to support variable sized members: struct indexed_ values { ... struct meta_data { ... In this case accessing meta_data->bar[ 15] for example cannot overlap with other members of runover into the zap member. Is this legitimate C? Thanks, Mike ... - Sat, Sep 25 2004 7:31 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d356579cbda50c29 OVeR grate - all new ---------------------------------- [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] ... - Sat, Sep 25 2004 8:06 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/308c6d67b81fe373 align to double or to long double? - 2 new ---------------------------------- I have rewrote the malloc() function of K&R2 chapter 8.7 typedef long Align; ... I know that in my pc+compiler sizeof(long)=4, sizeof(double)=8 and sizeof( long double)=10 (if 'long' or 'double' sizeof(Header)=8 if 'long double' sizeof(Header)=12) Can my x86 cpu read an array of long double aligned with double? union header { struct { union header* ptr; ... typedef union header Header; static Header base; static Header *freep=NULL; ... - Sat, Sep 25 2004 11:05 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/619ee28cc3038263 memory - all new ---------------------------------- On Wed, 22 Sep 2004 12:13:59 +0200, Jason Curl wrote: ... For me my is better with that I have found (and to correct) 3 memory bounds errors. In this way if I find a memory error to correct it is in twinkling of an eye. ... - Sat, Sep 25 2004 11:05 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/39e68316868ed3f4 New Hand of the C Program - all new ---------------------------------- Hello Everyone: Now I am study C Program. Can anyone introduce me some program websites or discussboards. Thanks!! ... - Sun, Sep 26 2004 12:52 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/561aa1e18014bafd ======================================================================= 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
