comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * very very very long integer - 21 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1459ddd29dac7c64 * swap two numbers - 20 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f358fd59e6131036 * K&R2 ex 1-8 - 11 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fae03b511e832c3f * A program that reproduces itself - 11 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4a9c9f2a28dd63b1 * contiguity of arrays - 8 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/367141614adee786 Active Topics ============= C to Java Byte Code - 3 new ---------------------------------- ... 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/88cb533585cafed4 Code Review Request: Newbie C programmer - 4 new ---------------------------------- Hello Peter, ... nice to meet you here. ;-) ... Well, what would someone like you write as an exercise? A 6502 disassembler? ;-) ... Well, these warnings are not serious. Chris Barts description is totally correct. Anyway, if you want to omit them (which is not bad, anyway, so you can have a better lock at the relevant warnings), you can do the following: Replace int address; by static int address; With the "static", you tell the tool chain that this variable should have internal linkage, that is, it is not visible from the outside. The... - Sat, Oct 16 2004 2:18 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fec6f1afc3222cdb Off Topic: Why is stdprn not defined under Windows? - all new ---------------------------------- pete wrote: ... Actually the structured storage device is not one of the files supported by the structured storage device, but rather is a file which is a physical device. ... - Sat, Oct 16 2004 3:53 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40b707dad6259a20 CORDIC algorithm - 2 new ---------------------------------- ... This is my version of log(), which uses Finite [Taylor] series approximations, in combination with range reduction. ... double l_og(double x) { int n; double a, b, c, epsilon; static double A, B, C; if ( x > 0) { ...... - Sat, Oct 16 2004 4:02 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/36ad8cdfebb8f992 C Puzzles - 3 new ---------------------------------- ... Not really specifically about C, but you can get good practice in implementing algorithms using the following problem set: http://acm.uva.es/ cgi-bin/OnlineJudge?Volume:1 You try to implement a solution (C/C++/Pascal/ Java allowed), test it locally, then submit it by e-mail or using a web form, and see... Cheers, Ivan... - Sat, Oct 16 2004 4:20 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f19833a22d4b52ec very very very long integer - 21 new ---------------------------------- ... http://www.google.com/search?q=bigint+C+library Several 'big integer' libraries have already been implemented. hth -Ivan... - Sat, Oct 16 2004 4:25 am 21 messages, 12 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1459ddd29dac7c64 scanf problem - 2 new ---------------------------------- Following is a fragment from a program I'm writing. I am trying to enter an 8 bit binary representation from keyboard which is then scanfed into &Ptext and then again into &Key1. This is not binary just a representation, when I print each character in the two char arrays, Key1 displays ok but Ptext is missing the first element. I'm stumped can someone please help. The following compiles and runs to show my problem. Thanks in advance. ... main() { char Ptext[8], Key1[8]; int i; printf("Enter 8 bit binary string Plaintext:... - Sat, Oct 16 2004 3:19 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d55345cadf79eef2 contiguity of arrays - 8 new ---------------------------------- ... It's an issue because the block of memory pointed at by the return from malloc() is required to be suitable to store any C object that will fit in it. That includes an array of ints. No such guarantee applies to statically or automatically allocated memory; it only applies to dynamically allocated memory. ... ... An array is stored in that format, but having something in that format doesn't make it an array. On many compilers, int a,b,c; will result three contiguous locations in memory being allocated as... - Sat, Oct 16 2004 7:02 am 8 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/367141614adee786 pointers to incompatible types - 5 new ---------------------------------- What is the chapter and verse for the following? ... void foo(struct bar *baz) ; struct bar { int x, y; ... int main(void) { return 0; ... Which, with gcc, yields: dec.c:3: warning: `struct bar' declared inside parameter list dec.c:3: warning: its scope is only this definition or declaration, which is probably not what you want. Is it just me or is this compiler stupid? Where is struct bar declared inside the parameter list? It would make sense if it was instead: void foo(struct bar { int x, y; } * baz); or something equally insane but this isn't... - Sat, Oct 16 2004 7:34 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/567165f7a38b577a arbitrary array index range? - 3 new ---------------------------------- On 13 Oct 2004 16:49:39 -0700, in comp.lang.c , [EMAIL PROTECTED] (Old ... Name one. Answer restricted to C code only. ... In the above case if ptr is of type void* then this should just fail to compile end of story. If ptr is not of type void, then your comment doesn't seem to make sense. ... What? ... - Sat, Oct 16 2004 8:16 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ace3b99f14b1bc78 bit masking - 2 new ---------------------------------- On Thu, 14 Oct 2004 00:13:03 -0500, in comp.lang.c , "Merrill & Michele" ... Ok, I won't. But in that case, why start a conversation about them? ... ok, F. U. C. K. W. A. D. How'd I do? ... - Sat, Oct 16 2004 8:22 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9466a48fca0d94ad How to retrieve the name of the file from a FILE * - all new ---------------------------------- On Thu, 14 Oct 2004 09:12:59 +0200, in comp.lang.c , jacob navia ... When I run it through my C interpreter on my Palmpilot, or compile it on my Vax 8800, and on my IBM S/360. And it also fails on my spare PC, on my Mac, on my Atari, on my Symbian phone, etc etc.... But I think you probably knew that ! ... - Sat, Oct 16 2004 8:26 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/301e181597d2c4fa K&R2 ex 1-8 - 11 new ---------------------------------- On Fri, 15 Oct 2004 11:10:41 -0500, in comp.lang.c , "Merrill & Michele" ... I realise you're doing this because you realised the param names are irrelevant, but really, don't do it. Its pointless and just annoys & confuses people. If you did this in a commercial environment you might get a warning for fooling about, and if you did it in interview you might be considererd too foolish to employ. ... In what way doesn't it work for the newline character? Please explain more clearly. ... - Sat, Oct 16 2004 8:33 am 11 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fae03b511e832c3f lcc-win32 - 4 new ---------------------------------- On Thu, 14 Oct 2004 10:45:23 +0200, in comp.lang.c , jacob navia ... I see. So, having failed to convince anyone when discussing it in the right place (which implies that your argument was weak, or your powers of persuasion small), you decided to come and annoy us instead? Sensible. ... Your attitude seems to be "they didn't agree with me, they must all have an evil ulterior motive". Perhaps you need to consider another possible explanation. ... - Sat, Oct 16 2004 9:00 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/60059ee1489ebe79 Write only memory - 5 new ---------------------------------- On Thu, 14 Oct 2004 23:32:05 +0200, in comp.lang.c , jacob navia ... The last doesn't exist. ... Tricky, since it doesn't exist. ... No, thats read/write memory that you've not yet initialised. Different animal. Your definition of write-only is asymmetric with your definition of read-only, which is a nono. ( I'm assuming you mean constants by that. If not, then you have no argument at all. ... - Sat, Oct 16 2004 9:06 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e31d94370ccee765 swap two numbers - 20 new ---------------------------------- hello all, this has been an interesting topic since long. you can swap two numbers (say a and b) using temp(as third variable). you can also swap without using third variable.like[ a=a+b;b=a-b;a=a-b; ]This was also done in three statements. Can anyon suggest this swapping in anything less then that. ... - Sat, Oct 16 2004 9:26 am 20 messages, 16 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f358fd59e6131036 cancel <[EMAIL PROTECTED]> - all new ---------------------------------- This message was cancelled from within Mozilla. ... - Sat, Oct 16 2004 11: 52 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1872cbfdd090a2da Safer and Better C - 4 new ---------------------------------- ... Actually, it does. Note that the (x=5) is included in the extra layer of parentheses, which is the _fix_ to allow such a situation to occur without the warning. Trying it in the context of the original actual problem - without the extra parentheses - it does, indeed, complain. One can hardly say "X doesn't do this" when it does _unless_ one takes steps to prevent it... and then test with code which has, in fact, taken those steps. Might as well compile with all warnings disabled and then complain the compiler doesn't detect any of a... - Sat, Oct 16 2004 11:56 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8313ab0630871577 Pointer to a Pointer to a struct - all new ---------------------------------- ... strncpy(p[0]->test[0],"Hello World",20); you have not allocated sufficent amount of memory to the test. Therefore,when you'll copy the string "hello world" to test, you will be overwriting the address of the main(void) function. As a result,the program will crash as soon as return statement will be executed. Aditya ... - Sat, Oct 16 2004 12:06 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/976267110bf99c54 A program that reproduces itself - 11 new ---------------------------------- Following is a C program, taken from http://en.wikipedia.org/wiki/Quine#Sample_ quine_in_C, which has the curious property that, when executed, it produces its own source code as output. ... {printf(x,10,34,x,34,10,10);return 0;}%c"; int main() {printf(x,10,34,x,34,10,10);return 0;} But I can't figure it out! Specifically, I don't know the significance of the hard-coded integers, nor how the % formatting characters work in this instance. Can someone explain just how this works? ... - Sat, Oct 16 2004 12:47 pm 11 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4a9c9f2a28dd63b1 Duff Device reference ... - all new ---------------------------------- In Tom's original post (see http://www.lysator.liu.se/c/duffs-device.html) discussing "Duff's Device" he refers to "another revolting way to use swtiches to implement interrupt driven state machines". My state machine may be considered revolting, and I was wondering if anyone could point me to state machine example source he was referring to. ... - Sat, Oct 16 2004 1:24 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/26f1de5982382bf9 get current path - all new ---------------------------------- On Fri, 15 Oct 2004 23:35:53 -0700 ... Damn. That's another job I can't apply for. :-)... - Sat, Oct 16 2004 1:29 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6f360ec160bc1663 problem to compile with... - all new ---------------------------------- ... ... Absolutely everything about Java is off-topic here. I suggest that you ask this in a Java group. ... - Sat, Oct 16 2004 11:49 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/699a339d08f4a90c Linkerproblem with mcal/datetime.h - all new ---------------------------------- Groovy hepcat Thomas was jivin' on Thu, 14 Oct 2004 20:29:58 +0200 in comp. lang.c. Linkerproblem with mcal/datetime.h's a cool scene! Dig it! ... Non- standard header. ... Unused parameters. What's wrong with the simpler "int main(void)"? ... Type struct datetime either undefined or defined in non- standard header. ... Function dt_now() either undeclared or declared in non- standard header. ... Function dt_dayofyear() either undeclared or declared in non-standard header. ... Function dt_setdate() either undeclared or... - Sun, Oct 17 2004 1:07 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a172fdc1d83e5433 c equivalence of const_cast? - 6 new ---------------------------------- I'm trying to convert some small piece of c++ code to c, only to ease linking it to a third language (I'm not knowledgeable in either c or c++). What would be the the c equivalence of: lpData=const_cast(Something); Trying to compile this with gcc 3.2.3 (mingw special 20030504-1) Thanks! Björn ... - Sun, Oct 17 2004 4:29 am 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b46d8e32494d8340 Floating-point bit hacking: iterated nextafter() without loop? - 4 new ---------------------------------- Ack! No replies! Bump. Or should I take the fact that there have been no replies to mean that the program supplied in the first post does work in practice?p ... For the background to the problem, I forgot to say that f(n)>0 and increases with n, i.e. n0<n1 -> f(n0)4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/463d85947a9395d9 NEWBYE - GRAPHIC QUESTION - 4 new ---------------------------------- I'm quite new to C developing, and I cannot understand how to print out not only ASCII characters but also some colorful lines and circles! I'm currently using Miracle C compiler for Windows. Please someone help me!! Thank you Andrea from Italy ... - Sun, Oct 17 2004 11:12 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/209491d42934a5c6 elementary construction +1 - 2 new ---------------------------------- ... In the same sense that a Ferrari is just as reasonable a platform for driving fast as a bulldozer. ... - Sun, Oct 17 2004 12:56 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/54b4e75539eebe6d Fatal: Unable to open file 'WS2_32.OBJ' - 2 new ---------------------------------- Hi everybody, compiling a program I receive this message: Fatal: Unable to open file 'WS2_32.OBJ' Object file "programName.OBJ" is created, but I can't link it. Anyone can help me, please? PS: I use Borland C++ 5.5.1 (with service pack 2) and O.S. winXP. ... - Sun, Oct 17 2004 3:30 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c4971eb80edab1b8 Please help with newbie code - 4 new ---------------------------------- Hi, I am learning how to program in C. Please help me by criticizing anything in the code below I wrote that converts int to binary and back. Is there something wrong that you see in the coding style, programming errors. Any pointers would be greatly appreciated. Thanks! When writing functions with more than one word for name, what is the standard practice - to use __ to join them or make them into one word ? For example, is binary_to_int more acceptable than BinaryToInt as name. I realize it makes no difference in terms of programming, but is... - Sun, Oct 17 2004 4:43 pm 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/916d0665d3804e1 Borland C and Microsoft Visual C - 3 new ---------------------------------- Hi, I'm trying to find out whether Borland C 4.5 and MVC still exist. I'm doing so as I have code that was compiled by them originally and wnated to recompile it using that code to do some testing. I've looked online and it seems like there's only the C++ version of them around. Could I just use the C++ compiler to compile my C stuff?? Thanking you, MS ... - Sun, Oct 17 2004 4:57 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/308120d194ea3e66 hexadecimal - 5 new ---------------------------------- Hi, unsigned long hex1; hex1=0x12345678; printf("Hex1: %#X",hex1); Why it only print 0x5678, instead of 0x12345678? Thanks. ... - Sun, Oct 17 2004 8:32 pm 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/423da4fecaea85df test - 2 new ---------------------------------- test ... - Sun, Oct 17 2004 9:42 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/42f0082af5c883af Is this legal ? - all new ---------------------------------- On 12 Oct 2004 04:06:14 -0700, [EMAIL PROTECTED] (K.M Jr) wrote: <snip> ... have been confusing this with something else: What _is_ UB is fetching, copying, passing, etc., as well as dereferencing, an _indeterminate_ pointer value, which includes one to space that has been free'd or otherwise become deallocated. But a null pointer is not indeterminate; it is a value provided ( in effect reserved) by the implementation that is reliably readable and writable and reliably not equal to any pointer to a valid object (or... - Sun, Oct 17 2004 10:24 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8c1b4f1068ac4449 char and unsigned char - 5 new ---------------------------------- Hi, char is 8 bit from -127 to 127 unsigned char is 8 bit from 0-255 from ASCII table, there is a list of char from 0-255. How char can be in negative value ? If I declare "char x", then can x hold char from 128-255 ? If want to hold value from 0-127 only? Thanks. ... - Sun, Oct 17 2004 11:25 pm 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/790d382b31000bc5 Super Mario Shapes - all new ---------------------------------- Where can I find geometrical Information to display the Super Mario Figure in OpenGL ? Is it free ? Is there a free clone ? Are other nice "actor" shapes available somewhere ? ... - Mon, Oct 18 2004 12:45 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e868d4cb8dc3c8a0 ======================================================================= 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
