comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * lcc-win32 - 22 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/60059ee1489ebe79 * Is this legal ? - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8c1b4f1068ac4449 * Systemdiag via c.prog - 10 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b9ffbdaffb55396c * flush(stdin) - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8f28b1d71eb15357 * Free C\C++ compiler - 9 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4aca51d9a5903ba5 Active Topics ============= Connect two pointers (arrays) - 6 new ---------------------------------- ... Please specify what you mean by 'binary array'. ... Do you simply want to append data to an existing array? Do you want to cause two separate arrays to become adjacent in memory, or what? -Mike ... - Sun, Oct 10 2004 10: 47 am 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ffc4422a76af88bd Linked List problem. - 8 new ---------------------------------- ... Your bug is on line 42. -Mike ... - Sun, Oct 10 2004 10:48 am 8 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7db25f536a8a0c30 EVIL AMERICAN GOVT (aka FBI) is full of SADISTS and PERVERTS - 6 new ---------------------------------- ... And you are posting this (mis)information to all those groups? You probably never thought of those people with low-speed modems do you? I think you and the OP should get together. Maybe you could get a discount when you two seek psychiatric help. Regards, Ron AF Greve ... ... - Sun, Oct 10 2004 11:05 am 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/50936ac526dc3143 having problems with math library - all new ---------------------------------- ... Correct you are. I'll remember the ballpark figure by it being somewhat smaller than Halliburton's no-bid contract. MPJ ... - Sun, Oct 10 2004 11:12 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/37e7c18bb573ca7 flush(stdin) - 9 new ---------------------------------- is this correct or incorrect i just read the post below before posting this: In fflush(stdin), what happens to flushed data? this program is taken from sams teach yourself c in 21 days /* LIST13-6.C CLEARING STDIN OF EXTRA CHARACTERS */ /* USING FFLUSH() FUNCTION */ ... int main(void) { ... my os is suse 9.1 pro the fflush function dosn't work. would the above program work in windows if i replace the flush function with void clear_kb(void) /* CLEARS STDIN OF ANY WAITING CHARACTERS */ { ... the above program works... - Sun, Oct 10 2004 11:58 am 9 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8f28b1d71eb15357 Variable number of parameters in a function call? - 3 new ---------------------------------- In article <[EMAIL PROTECTED]>, ... Then why do you give an example of f(...,f(...),...) ? It is certainly possible, of course, that this has nothing to do with the stated question (how to use the varargs capability of stdarg.h), but it acts as a potential decoy on people's attention. ... - Sun, Oct 10 2004 12:01 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b1f87f71866c2753 scanf address - 4 new ---------------------------------- hi all can anybody please tell me that how a C compiler searches for the defintion of the standard functions like scanf,printf,etc? Does the compiler knows in advance the location in memory where the definitions of these functions lie?If not,then what does it do to find the defintions fo these functions? Also can you please tell me that what is the difference between an object file and an executable file. Thanks in advance, Aditya ... - Sun, Oct 10 2004 12:01 pm 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9334ab42825f5bb what does "strict alignment" mean? - 8 new ---------------------------------- ... What I think you mean is, a 'char' is the smallest unit of memory that C guarantees you can address in C. But there's nothing preventing a machine architecture that is addressable down to a single bit having a C implementation where 'char' is 8 bits and only (bit) addresses that were zero mod 8 were used in that C implementation. Right? This is different from saying any [machine] address can contain a char. ... - Sun, Oct 10 2004 12:05 pm 8 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5c580627e15f2f4 Where can I find the implementation code for a function in C language? - 2 new ---------------------------------- In article <[EMAIL PROTECTED]>, ... There should be a convention on Usenet that would indicate when an editorial comment is being inserted "under cover" - that, is in a context that makes it sound like the thing being claimed is accepted fact. Clearly, when the previous poster used the word "uselessly", it was such an editorial comment (based, no doubt, on some previous threads in this ng). Had the poster posted it as: ... Then Mike would probably have (properly, IMHO) ignored the comment.... - Sun, Oct 10 2004 12:15 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a1b889c0a5be90f7 stdout not open? - all new ---------------------------------- On Sun, 10 Oct 2004 05:14:35 -0600, in comp.lang.c , Chris Barts ... No and yes. Whether they can or not is system-specific and you should not rely on ihs behaviour. ... Not only that, but some environments will complain if you try to assign them to something else. ... - Sun, Oct 10 2004 2:48 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d8537fea22f8858e lcc-win32 - 22 new ---------------------------------- On Sun, 10 Oct 2004 00:19:39 +0200, in comp.lang.c , jacob navia ... Ask yourself *why* none of these has been accepted as a standard (note the small S) . Is it perhaps because there is no standard need of these in C, or no standard interface that people need or.... ... - Sun, Oct 10 2004 2:52 pm 22 messages, 9 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/60059ee1489ebe79 double while loop in linked list - all new ---------------------------------- ... Please post the prototype of Relations. or better, a compilable code. . .. Well - I am guessing that the members word and dest are pointers to characters, from the next line . Assuming that, aktuell->word == aktuell2- >dest may not be what you want in the previous line. It is comparing pointers, instead of two C-strings. You may want 'strcmp' . ...... - Sun, Oct 10 2004 4:32 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6e19c591666d1692 Unitialized pointers? - 6 new ---------------------------------- Please take a look at ... int main() { char *cstring; FILE *fp; fp = fopen( "proc.rc", "r" ); fscanf(fp,"%s", cstring); printf("%s", cstring); return 0; ... The above code works on Utopia (Sun OS 5.7) and on Saturn (Linux 2.6.7) but it seg faults on artoo (FreeBSD 4.10) and on arcadia (NetBSD 1.6.1) So, I changed *cstring to an array of 100 chars like so... ... int main() { char cstring[100]; FILE *fp; fp = fopen( "proc.rc", "r" ); fscanf(fp,"%s", cstring); printf("%s", cstring); return 0; ... ...and this code works flawlessly on all... - Sun, Oct 10 2004 5:23 pm 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/bb92239d11686649 bit masking - 7 new ---------------------------------- ... Note though that pp-number tokens do not have a base. A token like 0188 is perfectly valid and could be used with macro operators. ... - Sun, Oct 10 2004 5:53 pm 7 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9466a48fca0d94ad string copy problem - 3 new ---------------------------------- I wanna initialize a 3D character string array with a string "abc" but the above VC 6.0++ compiler failed to do so. what's the problem of the below codes and how to modify it? char interface_aanum[10][100][4]; for (int k=0; k<10; k++) ... error C2107: illegal index, indirection not allowed error C 2664: 'strcpy' : cannot convert parameter 1 from 'char (*)[4]' to 'char *' ... ... - Sun, Oct 10 2004 6:49 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2f68364df479186f Julian timestamp to readable format - all new ---------------------------------- ... Hi Keith, I got from this link Best Regards, Satish ... - Sun, Oct 10 2004 7:07 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/29b7068f0b72beea Global variable declaration in headers - 2 new ---------------------------------- Groovy hepcat Method Man was jivin' on Sun, 10 Oct 2004 02:02:09 -0400 in comp. lang.c. Global variable declaration in headers's a cool scene! Dig it! ... File scope and external linkage. ... File scope and external linkage. ... File scope and internal linkage. ... File scope and external linkage. ... It would become a definition. Definitions are bad in a header. Headers should contain declarations, not definitions. ... - Sun, Oct 10 2004 7:15 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/29565adb8756b59c Recursive Union - 3 new ---------------------------------- ... Hi Jonathan, I have tried the same in Linux with CC compiler and it does not give me any error for the Union Defination. But in the function, unionTest (), it gives me compiler error for this statement. printf("%d\n", sizeof(u.a[ 4].i)); Error: union has no member named `i' If I comment out that statement, my code gets comiped and I get proper output. So the conclusion is, its a BUG in Windows compiler right? Thanks a lot Girish ... - Sun, Oct 10 2004 9:36 pm 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/33fcdf5f7b3e61e2 Doubt regarding const...... - 8 new ---------------------------------- Hi all, See the below code. Can u tell me what will be the output and why?? int main() { const int c = 16; int *p = &c; *p = 4; printf("c=%d, *p=%d",c,*p); return 0; ... I tested this on gcc, the result was c=16 *p= 4. As far as I think it should give error while changing the read only memory content i.e. c, or if it allow changes then it should reflect for bot c and *p. ... - Sun, Oct 10 2004 10:33 pm 8 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d5ff77b2dabc3713 How to create a bitmap? - all new ---------------------------------- ... Displaying the image on screen, and everything related to it is system- specific, and therefore off-topic here. Writing a bitmap file, or even creating a bitmap in memory, can be done in ISO C; the problem is figuring out what kind of bitmap you want. Once you've figured that out (and that, again, depends on your hardware and OS), it all just boils down to writing the right bytes in the right place, using fwrite(), memcpy(), or simple assignment through pointers. That done, you need to display the image - and that is beyond ISO C,... - Sun, Oct 10 2004 11:36 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8508d0249a317c6a byte to LONG - 6 new ---------------------------------- Since you got the four received bytes: unsigned long l; char *p; p = ( char *)&l; *p = byte_2; /* 0x3d, Assuming little endian */ *(p+1) = byte_ 1; /* 0x8e */ *(p+2) = byte_4; /* ox5f */ *(p+3) = byte_3; /* ox64 */ Now you should contains 0x645f8e3d; well, you get the idea... ... ... - Sun, Oct 10 2004 11:47 pm 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4766398d62071600 When fopen() fails - 2 new ---------------------------------- ... No, it won't. It will compare to a _source_ zero, because that's also a null pointer constant, but that's a special property of the null pointer constant, _not_ of the null pointer object. It need not, for example, compare equal to an integer object with value zero. ... I realised that, I just thought I'd point it out explicitly for the lurkers. Richard ... - Mon, Oct 11 2004 1:14 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/36bb96c0349e4c1f Systemdiag via c.prog - 10 new ---------------------------------- Hello NG, I want to write a c-prg. which examines the current memory-usage and cpu-usage of the system (win32), and writes the values to a logfile. Does anybody know which librarys or functions I should use? Unfortunately I'm almost new to programming in c :-( Thanks, bastian ... - Mon, Oct 11 2004 1:16 am 10 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b9ffbdaffb55396c Some advice about references on memory management in C - 3 new ---------------------------------- ... <snip> ... Noted. However, I am still pondering the architecture in use today which does not. I know about IBM 360, but those are ancient (in computer terms). ... - Mon, Oct 11 2004 3:25 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d43a5100422834e4 Newbie-Question: Function-Parameters - all new ---------------------------------- ... Never mind... I once cancelled a message 4 times before getting it right. Admittedly that ws prolog, but the idea is the same. ... - Mon, Oct 11 2004 3:30 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c1a24dc411260b72 tree problem - 6 new ---------------------------------- Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number the inserts are totally out of order. where IPAddress is four ints Node is an IPAddress, portNumber, left pointer and right pointer Nodeptr is a pointer to a Node Nodeptr add(Nodeptr tree, IPAddress ip, int portNumber) { if(tree==NULL) { ... else if(ip.digit1 < tree->address.digit1) { tree->left = add(tree->left,... - Mon, Oct 11 2004 3:39 am 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dbd1b79ea508ab09 What is a type? - 2 new ---------------------------------- ... I'm afraid I don't see that. Yes, you have a bit of code apart from the publically visible headers, but then, isn't that true for most of the internals of any implementation? The only problem I see is that it makes it harder to design the library and the compiler separately, but nobody's forcing you to go that way. Richard ... - Mon, Oct 11 2004 7:37 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dec90ce2a90b6f1b Free C\C++ compiler - 9 new ---------------------------------- ... It does? Amazing. Shouldn't they be ridiculed greatly and publicly for doing so, after all their previous fulminations against the open source movement? Richard ... - Mon, Oct 11 2004 7:37 am 9 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4aca51d9a5903ba5 Compiler for Windows (Open Source) - 2 new ---------------------------------- ... And, once you get used to make files, you can simply put them in your template make file (the file you use when creating a make file "from scratch") . Dan... - Mon, Oct 11 2004 7:20 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3a3f1be81286bc7a Why 'sizof (CBuffer::m_pData)' doesn't work ? - 5 new ---------------------------------- Hello I've noticed that 'sizeof (CBuffer::m_pData)' doesn't compile. Is this behavior present by chance or there is a good reason for it ? Is there a better alternative other than sizeof ((CBuffer *)NULL)->m_pData wich I currently use ? Thank you Timothy Madden Romania ... ... - Mon, Oct 11 2004 9:20 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/820043448c31f7a4 Off Topic: Why is stdprn not defined under Windows? - 3 new ---------------------------------- ... The purpose of 7.19.3 p1 is to simplify the wording used in the rest of section 7.19. We'll pretend from now on that I/O happens to files ONLY, even if we have already acknowledged that this is not the case. Feel free to believe that /dev/null is a file on Unix systems, but don't tell it to other people :-) A couple of years ago I wrote a Linux device driver for a hardware watchdog (a device that automatically reboots the system if activated and then left alone for a certain time). A C program could fopen() it, which... - Mon, Oct 11 2004 8:12 am 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40b707dad6259a20 Array size using pointer - 7 new ---------------------------------- Hi, is it possible to find the dimension of an array using a pointer? main() { int a[10]; f(a); return; ... f(int *b) { /*how can I know here the size of b??*/ /*because sizeof(b) is always 4*/ /*and sizeof(b[0]) is always 4*/ ... Thank you Dati ... - Mon, Oct 11 2004 8:50 am 7 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/24fc6283b76ef439 error w/ pointer to structures - 3 new ---------------------------------- I'm having a problem using pointers to structures. One method of declaring point and then referencing a structure works, while the other generates an error at compile time. ... struct data { int a,b; ... struct data *p_ data = &myData; /* define pointer and reference on ... struct data { int a,b; ... struct data *p_data; /* declare pointer of type data * / p_data = &myData; /* reference pointer to struct myData */ ... ex2. does the same thing as ex1. put just splits it apart on separate lines.... - Mon, Oct 11 2004 8:55 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c05f572e9e713de9 why this C code did'nt works as expected - 6 new ---------------------------------- Hi all, Can body please me that why the following code in not working as expected.Basically,my aim was to shift the control from one function to another as soon as I presses Control-c keys. In other words,I was expecting the program to execute in the following way- 1. Initially,the control is in the while loop of the main function. 2. I presses the Control-c keys,then the control should have passed into the g() via the handle function(which is the case). 3. When I presses the Control-c keys,the control should have gone into... - Mon, Oct 11 2004 12:52 pm 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ff6d5e5f30280c50 K&R 1.5.1 exercise - 7 new ---------------------------------- It's very difficult to do an exercise with elementary tools. It took me about fifteen minutes to get exercise 1-7: ... int main(int orange, char **apple) { int c; c=-5; while(c != EOF ) { c++; ... printf("%d\t",EOF); return (0); ... it's right. Exercise 1-6 is giving me dyspepsia. This compiles and links but does not behave according to my wishes: ... int main(int orange, char ** mango) { int c; c=(getchar() != EOF); printf("%d\t",c); return (0); ... I'm looking for a 0 or 1 when I peck randomly at the keyboard, and am at my... - Mon, Oct 11 2004 7:20 pm 7 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f77b20dad505718c File locking - 5 new ---------------------------------- ... ... You only have to implement mutual exclusion if your processes need exclusive access. You can have multiple processes concurrently reading and writing to a file without using mutual exclusion if you don't mind seeing old data, new data, or mixtures of both. You the kernel doesn't ever force you to use mutual exclusion. You only need it if you can't meet one of your requirements without it. DS ... - Mon, Oct 11 2004 8:27 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4a6f51a62cd3483b authentication - all new ---------------------------------- ... OS dependent. john ... - Mon, Oct 11 2004 11:46 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3c3c91d316b2f237 Is this legal ? - 12 new ---------------------------------- Hi group, I want you to tell me if the following code is legal as per Standard. void foo(int *p) { ... int main(void) { foo(NULL); ... I thought that even copying NULL pointers was a cause of Undefined Behavior. Am I mistaken ? Thanks. ... - Tues, Oct 12 2004 4:06 am 12 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8c1b4f1068ac4449 LNK 2001 error using the cl compiler?? - all new ---------------------------------- [EMAIL PROTECTED] (Mary) wrote in news:9755e141.0410120328.686075ea@ posting.google.com: ... Mary, C does not specify how the cl compiler works, does not support classes (that's C++), nor does it include the win32 API. Thus, this question is off-topic here. There are many Microsoft newsgroups available, I suggest you find one that deals with win32 and programming. ... - Tues, Oct 12 2004 6:01 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6261d4452c52a3b7 friends, namespaces and operators. - 2 new ---------------------------------- glen stark scribbled the following: ... comp.lang.c++ is that way ============ =================================> ... - Tues, Oct 12 2004 6:40 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fcd1aaf2c2c3ac87 Copying structs - 2 new ---------------------------------- ... As anticipated by K&R1, it was actually legal since soon after K&R1 went to print, when Unix V7 was released (it came with a one page addenda to K&R1 document). At the same time, C acquired enumerated types. Dan... - Tues, Oct 12 2004 8:08 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6f328426ee192ea8 cancel <[EMAIL PROTECTED]> - all new ---------------------------------- This message was cancelled from within Mozilla. ... - Tues, Oct 12 2004 9: 32 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b2d5ed80e6872e49 ======================================================================= 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
