comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * C call of a C# dll - 22 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9923bd86ab96f4 * PROS/CONS: #define BEGIN { - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b40778122b55c18a * Dynamic C String Question - 11 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9c6dcd4f43190b20 * "free space" with declared type - 11 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ea705eb6ba84f013 * Call function address stored in type of size_t? - 10 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6d2c8e898569aa31 Active Topics ------------- Coding [style] standards - 4 new -------------------------------- ...Maybe they don't. ...I don't know about you, but I am human. And as such I use language in certain ways to enhance my understanding of many things. a == b says to me that the important things here is that a is equal to b, not that b is equal to a. Now, they mean the same thing, but being human... Maybe you perceive this as a flaw, but hey, I've found a - Tues, Dec 21 2004 8:56 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/45fff8e456da3b6e 3D array pointer arithmetic - 5 new ----------------------------------- .../* Constructor */ nml_itensor* (nml_it_new)( nml_extent l, nml_extent m, nml_extent n) { nml_iscalar*** ppp = (nml_iscalar***)nml_calloc(4+l, sizeof( nml_iscalar**)); if (NULL != ppp) { *ppp = NULL; ++ppp; - Tues, Dec 21 2004 12: 19 am 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/208fe71928438cdc strncat copies junk values .... - 6 new --------------------------------------- Google was not able to retreive the message .. so I couldnt write a followup .. I guess this one will be displayed as a new post ... anyways, thank you all people for all your replies .. can you please clear one more question .. As you have said, the cast is not needed, in the following statement .. - Tues, Dec 21 2004 2:07 am 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c3f41c30127b5549 C call of a C# dll - 22 new --------------------------- ...Then, to avoid confusion, you should rename your (sic!) NG comp.lang.pure.c, comp.lang.1990iso.c, comp.lang.1999iso.c or comp.lang.kr.c. ;-) Otherwise guys like me will bother you with OT questions all the time. Seriously, would you "reject" some C-related quesion only because the code snippet illustrating the problem used some - Tues, Dec 21 2004 11:10 am 22 messages, 13 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9923bd86ab96f4 "free space" with declared type - 11 new ---------------------------------------- ...It is already impossible to write a portable general allocator like malloc() because you can't portably determine what alignment meeds the requirements of all objects the implementation can support. In order to write your own allocator you have to get memory from somewhere. You could use some extension to reserve it in which case you're - Tues, Dec 21 2004 10:25 am 11 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ea705eb6ba84f013 Binary to ascii encoder - 3 new ------------------------------- Hi, I needed a basic binary to ascii encoder, so I wrote this piece of code: /* Encoding algo: suppose 11111010 is the byte to be encoded. It is first broken up into two 4-bit parts (1111 and 1010) This 4-bit quantity is then padded between a 01 and a 10, ie, 01xxxx10 will be written out to the output file. - Tues, Dec 21 2004 2:43 am 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/33e5eac3db174ab0 Missing Graph.h and (Graph.lib) woes - any help - 2 new ------------------------------------------------------- ...c.l.c is definitely the wrong place to look, since we deal with portable standard C. If your old C code is old enough you might find the whole system in the Borland museum. At any rate microsoft groups are unlikely to pay off, but alt.folklore.computers might. Also check Borlands own newsserver and their private newsgroups. - Tues, Dec 21 2004 11:11 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8d398e0062fbe57f role of semicolon - 3 new ------------------------- ...... ...That may be the point Dik was making, in which case I missed it. My point, and what I thought Dik was referring to, was different but IMO more relevant to the discussion about statements and compound statements. Lawrence - Tues, Dec 21 2004 11:13 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/51e0bfccfbbc693 Macros that break compiler headers - 1 new ------------------------------------------ ...However you get undefined behaviour, at least I think so. C99 6.4.1p2 says "The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as keywords, and shall not be used otherwise." The question is whether the "and shall not be used otherwise" restriction is limited to translation phases 7 and 8. I don't think it can be because - Tues, Dec 21 2004 11:36 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dddf88911f2ac26f Is there a library function for placing cursor position in the cosole? - 2 new ------------------------------------------------------------------------------ ...Not really, since as you mention below they don't use a valid program startup mechanism for a hosted implementation. ...Console apps can use GUI facilities, so that's really the only area combination that could be relevant. ...Then of course they can do what they like, but we know that anyway. :-) - Tues, Dec 21 2004 11:44 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8777a782cb1bc23c typedef [OT] - 5 new -------------------- ...complaints? ...Maybe. Depends on the definition of a 'word'. On a 80x86 you are right, on a Z80 you are wrong. - Tues, Dec 21 2004 1:08 pm 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f2cf2a8a76eb3071 Is there any GENRIC MACROS in c for INTEGERS,CHARACTERS ? - 9 new ----------------------------------------------------------------- ...If you have a negative integer value, like ...then isdigit((unsigned char) NEG_5) will return true, as it should, since putchar(NEG_5) will return '5'. - Tues, Dec 21 2004 12:23 pm 9 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cafd52e524781b8e Learning C with Older books ?. - 2 new -------------------------------------- ...It isn't up to the compiler to impose style considerations on the programmer. It is dumb because a less dumb compiler could easily prove that in this case i can never be negative so "surprising" results simply can't happen, on any conforming C implementation. So there aren't even portability issues. - Tues, Dec 21 2004 12:35 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/66bc74d8d8d22b33 Question about unpacking a binary file: endian troubles - 8 new --------------------------------------------------------------- On 20 Dec 2004 19:45:35 -0800, Robert ...You need to ask in a CGI or web newsgroup about that, it will be specific to that environment. ...You will be dealing with octets with strange values (0x00 in particular may well give problems). You need to encode that data in the format expected by the application receiving it, which may be decimal, hex, - Tues, Dec 21 2004 12:23 pm 8 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/703924ad651c57db Anyone have experience of using GraphApp? - 4 new ------------------------------------------------- I need to ask a question on building for Windoze platform - Tues, Dec 21 2004 1:23 pm 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/176a54af2343621f PROS/CONS: #define BEGIN { - 12 new ----------------------------------- ...Well, how often do you have nesting errors? I can't remember when I last saw or heard of one. And it is not obvious at all to me that BEGIN and END are easier to remember to put in than { and }. Especially if you are using a syntax aware editor then you will immidiately see a nesting error. Though one thing that does reduce nesting errors is to put in both - Tues, Dec 21 2004 1: 40 pm 12 messages, 9 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b40778122b55c18a Command line C compiler needed - 3 new -------------------------------------- ...Dev-C++ is (or at least, can be) a single download, and also comes with make, ar, and so forth. Not with ls and similar, though. Richard - Tues, Dec 21 2004 1:47 pm 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/47dc807a6237d819 size_t - 2 new -------------- In article <[EMAIL PROTECTED]>, ...I agree with Dan here. Unsigned's are not "appropriate" for array length, just because negative array length happens not make much sense. They are inappropriate because they are used as cardinal (how much) and ordinal (where). Or in plain English they are - Tues, Dec 21 2004 1:23 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d072a602a9810a17 threads / malloc / free / global array - 2 new ---------------------------------------------- ...Yes sticking to C library makes a program more portable but you can not say that a program is not following the standard just because it uses a non ANSI library. Using a non ANSI library is not an extension to the language. Is an application of the language. ...Ciao Giovanni - Tues, Dec 21 2004 5:23 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/146373d697d992f2 pointer and array - 10 new -------------------------- In the Brain and Denis' book "The C Programming Language" Section 5.3 "Pointes abd Arrays", a statment goes: "Any operation that can be achieved by array subscripting can also be done with pointers." Then the authors continute with "The pointer version will in general be faster ...." My question is why the pointer version would be faster? - Tues, Dec 21 2004 10:04 am 10 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e4c870ac8a719063 Over optimization - 9 new ------------------------- When performance benchmark testing one of my own functions against the equivalent runtime function, I found that with /Ox on it optimized away its own function so that it didn't call it *at all* after the first loop. < psuedocode> ...QPC(start); for(long i = 1; i<BIGNUMBER; i++) dummyvar = testfunc(argv[1]); - Tues, Dec 21 2004 7:41 pm 9 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6bd7c344f36177cc Reverse polish - 1 new ---------------------- ...news:[EMAIL PROTECTED] ...Your problem is implementing an infix to reverse Polish algorithm. Once you understand that, writing the code in C, Basic, or indeed any programming language ought to be relatively striaghtforward. So it's not a comp.lang.c question. - Tues, Dec 21 2004 8:23 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b58e7aa433724b4a Hows my code - 5 new -------------------- The following code is the heart of a program that I wrote to extract html tags from a webpage. How efficient is my code ?. Is there still possible way to optimize the code. Am I using everything as per the text book. I am just apprehensive whether this may break or may cause a memmory leak. Any chance for it. - Tues, Dec 21 2004 1:34 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e526958c41d0f5fc conditional inclusion - 1 new ----------------------------- ...I like the robustness of this version, but I find using the defined() operator better suited to my tastes: ... #error "Both VERSION1 and VERSION2 defined" ... #include "version1.h" ... #include "version2.h" ... #error "Version not specified" ...(I've quoted the argument to the #error directives because some - Tues, Dec 21 2004 9:20 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7fa4566d02abd2e2 Array length - 4 new -------------------- I could not find anything about this in the FAQ, so: I have a two-dim array, foo[a][b] (a and b are arbitrary). How do I get C to return the length of e.g length( foo[a] ) = 4, i.e the number of x and y in the array? Thanks. Ronny Mandal - Tues, Dec 21 2004 11:34 pm 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/391dcc48193009c1 Code To Make Trial Version Software Release - 5 new --------------------------------------------------- Hi, I need to modify an existing application that's written in C, C++ and Visual C++ so the application can be released as a time limited trial version, also the modifications must prevent the application from being reinstalled on the same computer after the trial period has timed out. Does anyone know of any C/C++ code that I could use directly or modified - Tues, Dec 21 2004 3:46 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ca0f25c303a0851a [OT] Request GMAIL Invitation. - 2 new -------------------------------------- ...[snipped] ... Does n't the same thing hold for any free email service, though ? - Tues, Dec 21 2004 5:54 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/419e3af3c4a7ee42 Call function address stored in type of size_t? - 10 new -------------------------------------------------------- Hello all, I'm very new to C but I have a number of years of Common Lisp programming experience. I'm trying to figure out ways of translating higher order concepts such as closures into C. The code will not be idiomatic C. GCC has an extension to ISO C that permits nested functions: < [link]> - Wed, Dec 22 2004 3:43 pm 10 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6d2c8e898569aa31 Dynamic C String Question - 11 new ---------------------------------- I'm writing a program in C, and thus have to use C strings. The problem that I am having is I don't know how to reallocate the space for a C string outside the scope of that string. For example: int main(void) { char *string1; string1 = malloc(6); sprintf(string1, "Hello"); foo(string1); ...void foo(char *string) - Tues, Dec 21 2004 9:29 pm 11 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9c6dcd4f43190b20 Gaussian random number generation in C? - 1 new ----------------------------------------------- ...only ...Usenet ...What is the mean of the distribution if I take say 10000 random numbers? The code I got is given below: ...double gaussrand() { static double V1, V2, S; static int phase = 0; double X; if(phase == 0) { do { double U1 = (double)rand() / RAND_MAX; double U2 = (double)rand() / RAND_MAX; - Tues, Dec 21 2004 11:16 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e8860449f02d0a3c ============================================================================== 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
