comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Pointer initialization question... - 11 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a73a5b31bd5dd852 * memory alignment - 10 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/819b49c577553db9 * Pointers in c - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fa61be9ea4fe3db1 * Problem on Array - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a7d7bab02b11eb24 * C call of a C# dll - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9923bd86ab96f4 Active Topics ------------- memory alignment - 10 new ------------------------- but what KR mentioned that it is safer to cast a larger data type pointer into a smaller one. But the vice versa is dangerous. e.g. char is the smallest data type available , so pointer to every data type can be casted to char*. please point me if I i am wrong. and in above snippet why we need to add 1 in statement foo = 1 + - Mon, Dec 27 2004 12:15 am 10 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/819b49c577553db9 C call of a C# dll - 6 new -------------------------- ...Of course not. I never said anything like that. ...But I _am_ investigating. I'm not relying (only) on Usenet. It's just that I had good experience with Usenet so far. Especially with "little" things, directions mostly, the things that don't require knowing all the gory details of a particular "technology". - Mon, Dec 27 2004 9:17 am 6 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9923bd86ab96f4 Pointers in c - 9 new --------------------- ...Knowing your code is no guarantee for _not_ f.ing up somewhere, inadvertently. As soon as you have a certain complexity, setting pointers to NULL (*) and assert()ing elsewhere that you do not have a null pointer may be a good idea to make sure that you did at least this thing right and catch no uninitialised/invalidated - Mon, Dec 27 2004 9:19 am 9 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fa61be9ea4fe3db1 Pointer initialization question... - 11 new ------------------------------------------- Hi all: Below are two pieces of code that basically perform the same task. Version A produces a segmentation fault, while version B works correctly. I understand why version B works correctly, but I do not understand why version A does not work. It seems to me that in Version A, a pointer to an array of integers is passed as a parameter to - Mon, Dec 27 2004 12:29 am 11 messages, 10 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a73a5b31bd5dd852 Systems software versus applications software definitions - 1 new ----------------------------------------------------------------- ...One of the oldest jokes in this profession: Q: What is the difference between application programmers and system programmers? A: The latter can make other people's programs crash! dk - Mon, Dec 27 2004 3:57 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3fa8770993ebe026 Detect direction of stack growth - 3 new ---------------------------------------- ...It would make more sense to cast to intptr_t or uintptr_t (assuming a C99 implementation), but these types aren't guaranteed to exist, and even if they do they aren't guaranteed to behave the way you want them to. ...None. ... Addresses can't necessarily be interpreted as integers. There has to be some stack-like first-in last-out data structure to support nested - Mon, Dec 27 2004 9:39 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/36293757e89add3a Is there any GENRIC MACROS in c for INTEGERS,CHARACTERS ? - 2 new ----------------------------------------------------------------- ...[...] ...Whoops, you're right. - Mon, Dec 27 2004 9:48 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cafd52e524781b8e compiler bug or misuse of a cast? - 3 new ----------------------------------------- Hi, In the following code fragment, gcc seems to ignore the initial value assigned to pData. (compiled -fvolatile -O2 with gcc) void test(void) { void * pData = (void*)0x3400; pData = (void*)(*((unsigned char**)&pData) + 4); memcpy( pData,(void*)0x1000,10); return; ...The generated code simply reads whatever garbage is at [sp], adds 4 to - Mon, Dec 27 2004 5:28 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2f38d4d20f0d7c55 Language efficiency of C versus FORTRAN et al - 3 new ----------------------------------------------------- To optimize the performance of linear algebra operations, one should consider calling hardware-specific libraries, such as the Intel Math Kernel Library [ link] or the AMD Core Math Library (ACML). Typically, such libraries are callable from Fortran, C, and C++. - Mon, Dec 27 2004 5:42 am 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d2a96d38c42413 Problem on Array - 9 new ------------------------ Hello Every body, I am new with C programming.I have received the Problems from my advisor on Array but I did not find any Proper answer yet. If Possible, please make a solution for the Problems. Thanks The Problems are as follows: 1- Declare an array of length of 10 and read integers into the elements - Mon, Dec 27 2004 6:19 am 9 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a7d7bab02b11eb24 Reverse Auction of Programming Contracts - 1 new ------------------------------------------------ Not anymore. The domain is for sale. - Mon, Dec 27 2004 6:31 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3140d1757fe57637 scanf in a for loop - 1 new --------------------------- ...First of all I believe the scanf statement as listed above has a slight error. The "i%" should be "%i". Retry the program with this correction and see what happens. - Mon, Dec 27 2004 4:40 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/aebc3f924a267595 global Variables - 1 new ------------------------ ...I'm now programming for more than 20 years not only in C: There are something that speaks against od using global variable: - globals are visible outside its intent. - globals can be changed anywhere in the module or if defined as extern in the whole program - it makes the maintenance not even easy - Mon, Dec 27 2004 10:47 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dd3e5ad32322a3f2 2 dimensional strcpy err - 1 new -------------------------------- Ross wrote: ...First of all - post real code. The code you provided cannot result in the above error message. - Mon, Dec 27 2004 6:10 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/426dd4ab4b5d92ee Call function address stored in type of size_t? - 1 new ------------------------------------------------------- In article <[EMAIL PROTECTED]> ...I had a brief look at it, and it appears to make some nonportable (and unnecessary) assumptions. The biggest (and perhaps only[%]) one is that "struct S *" and "void *" have the same underlying storage size and/or representation. C89 implies, and C99 requires, that "struct S *" and "struct T *" - Tues, Dec 28 2004 5:15 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6d2c8e898569aa31 strncat copies junk values .... - 1 new --------------------------------------- In article <[EMAIL PROTECTED]> ...Perhaps I should just quote from the manual page (since no one else has responded yet): The strlcpy() and strlcat() functions copy and concatenate strings respectively. They are designed to be safer, more consistent, and less error prone replacements for strncpy(3) - Tues, Dec 28 2004 5:26 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c3f41c30127b5549 This C program prints 1 - why? - 5 new -------------------------------------- main() { static int a[] = {1,2,3}; printf("&a[1]-&a[0]=%u\n",&a[1]-&a[0]); ... If you compile the above program and run it prints 1. Why? I printed &a[0] and &a[1] separately and the difference is 4 and not 1 Question: Huh? Please see below: &a[0]=133208 &a[1]=133212 &a[1]-&a[0] = 1 - Mon, Dec 27 2004 10:23 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b36fabe7ede599ca Hows my code - 1 new -------------------- ...while (ch = scan_buffer[i++]) { - Tues, Dec 28 2004 8:08 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e526958c41d0f5fc is NULL-checking redundant in accessor-functions? - 1 new --------------------------------------------------------- Message supprimé par MesNews - Mon, Dec 27 2004 11:29 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fc3530088eb3edbc Coding standards - 1 new ------------------------ ...Let me give my two-cents' worth. I'll start with a question for the ` indent' users. One almost gets the impression that two guys in adjacent cubicles run their own customized `indent' whenever sharing code. If you get a paper printout, do you OCR it and `indent' the result? I'm not being sarcastic; I just don't understand - Mon, Dec 27 2004 11:33 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/45fff8e456da3b6e ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.c" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.c To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.c/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
