comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Not STD C is "not C" ? ----WAS: Re: C to Java Byte Code - 7 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/88cb533585cafed4 * C... Why not c++? - 7 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/729e593ab5747942 * dynamic allocation - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c86ae177cb7dd736 * Survey on Newsgroup Behavior - 5 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/68b2a03b7c9914d0 * assert( x > 0.0 && 1 && x == 0.0 ) holding - 5 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d35b138dec22feed Active Topics ============= Off Topic: What is multithread safety - all new ---------------------------------- "goose" wrote ... globals, static variables, pointers which may have been passed to other threads and, of course, calling non-thread-safe suboutines. eg int threadsafe(int x, int y) { return x + y; ... int notthreadsafe(void) { static int count = 0; return count++; ... The problem is that it seldom any use to have two threads in a program that do not communicate with each other at all. Somehow information has to get from thread1 to thread2, and this opens up a whole set of complications,... - Sat, Oct 30 2004 2:06 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a349b9ed0d65f0d3 couple of questions on streams - all new ---------------------------------- "Michael Wojcik" wrote ... wonderful things with the OS. Generally these can be ignored. This didn't use to be true, for instance in the 286 days you had to access the screen buffer directly to get decent performance in a full- screen app (the conio routines were too slow). Nowadays it is usually a waste of time trying to speed up a program by replacing stdio calls with your own routines that call low-level ops directly. Note I said usually, if you are implementing a database engine or something similar then... - Sat, Oct 30 2004 2:17 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/999c750f9c648b21 Survey on Newsgroup Behavior - 5 new ---------------------------------- Okay, I had to decide whether I (a) ask you for your e-mail or names or any identification, so that I could look up all your data, or (b) not to do it ( make the survey anonymous), with the implication that I could not access the posting archives. I decided for (b). Don't ask me if it was the right decision. Jens ...... - Sat, Oct 30 2004 2:10 am 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/68b2a03b7c9914d0 position independet code - 4 new ---------------------------------- ... // increments accumulator if not equal to X register 8000 CMP A, X / / compare accumulator to x register 8001 JMPZ 8003 // jump if equal to 8003 8002 INC A // increment A 8003 RET // returns Ad this 8000 CMP A, X 8001 BRNZ +2 // BRNZ branches forwards or backwards by a set number 8002 INC A 8003 RET The second will work if moved to a new position, but the first has the jump destination hardcoded and will not. ... - Sat, Oct 30 2004 2:28 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/40760e48df627018 assert( x > 0.0 && 1 && x == 0.0 ) holding - 5 new ---------------------------------- On 29 Oct 2004 16:39:04 -0700, Daniel Vallstrom ... It all depends (as the late Professor Joad used to say) on what you mean by equality of floating point numbers. Or rather, on what your compiler and processor think it means. Can you get your compiler to generate assembler code and check? It may be that it is looking for "absolute value less than a very small amount" for equality, and the value is not quite zero. Or perhaps your multiply which generated it resulted in underflow and a NAN ("Not A Number", a... - Sat, Oct 30 2004 3:37 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d35b138dec22feed Extract a function from C code? - all new ---------------------------------- ... It seems not so hard : * first, to establish the name of all functions automatically, considering the 300 'Utility.c' files, * second, to suppress the function names, which aren't interesting for you, by hand of course, * third, to extract the implementations function by function, from the 300 files: ... These tasks are easy to implement with CodeWorker (see the extraction further, for instance). If you are interested, I can help you. ... - Sat, Oct 30 2004 4:20 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/142137b736cb8ea0 Can use macros to solve this problem? - all new ---------------------------------- ... Can't you find a way to do:- FunctionT() { // do some conversion first if (some_condition) { FunctionW(); ... { FunctionA(); ... If the conversion steps are the same for all the functions? It would make things a lot simpler. ... - Sat, Oct 30 2004 4:53 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9d10811ec434717 reentrant functions - 2 new ---------------------------------- ... Obviously homework, the same as the OP's other question about position independent code. Reentrancy is a characteristic of a program in memory that does not modify itself in any way. Thus, multiple threads (units of work) can concurrently execute the code without interferring with each other. Reentrant programs can be shared by multiple threads and by multiple processes, because the program itself is essentially "read only". Non-reentrancy is a characteristic of a program in memory that is modifying itself as it executes.. .. - Sat, Oct 30 2004 7:50 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8282d3ee818642b8 GetByte(int x, int n) - all new ---------------------------------- ... [SNIP, SNIP, SNIP!] ... I believe the answer is, it depends on the definition of UCHAR_MAX. If UCHAR_MAX is defined ... or ... or ... then the conclusions above are correct (in the last case because of the ANSI "value preserving rule" for promotions, and assuming that sizeof(int) > sizeof(char) is true). If UCHAR_MAX is defined ... then the conclusion about the case when sizeof(long) > sizeof(int) is right but the other conclusion is wrong. If UCHAR_MAX is defined ... then both conclusions are wrong. Reading 5.2.4.2. 1 p1, the type of UCHAR_MAX... - Sat, Oct 30 2004 8:10 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c5aa5da0d5dfa7f0 ANN: id2id-20 now available - all new ---------------------------------- id2id ver 2.0 is now available. A replacement for the original version. This does not avoid comments and strings, and uses different algorithms. The hashlib package is a prerequisite, and supplies the storage. This is a complete rewrite, in a different language and thus begins life as version 2.0 of id2id. Id2id reads a list of idpairs in the form of lines holding oldname newname and then applies all those changes to the file specified. It does this with a single pass through the file, and thus is almost as quick as simply copying the file.... - Sat, Oct 30 2004 8:33 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2310165449ab2aca problems in saving to a text file - 4 new ---------------------------------- hi below is my save function that is used to placed data from the C program to a text file for future usage. void save() { FILE *save; int i = 0; save= fopen("employeerecord.txt", "a+"); do { if(strcmp(record[i].ID, "")!=0) { if(i!=0) ... record[i].Name2, record[i].Department[storage], record[i]. Post[rank]); ... { break; ... There was no problem for me to save the first employee and the second but when adding the 3rd employee data, this is what appears in the text file ... 1121 sonia cooling Management Maid 1121 sonia... - Sat, Oct 30 2004 8:48 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/831b372e40df3811 Not STD C is "not C" ? ----WAS: Re: C to Java Byte Code - 7 new ---------------------------------- Dik T. Winter coughed up: ... I'm not asking anything, I'm making an observation. I need no questions answered. Are you sure about the aim in the comp.lang.c group being "portable C"? I don't see that as the charter at all. (I apologize for the huge crosspost-it was inherited, and perhaps I should have narrowed it away from C++). Here is what the official list of big eight newsgroups says, as posted continually in news.announce.newsgroups: ... That list is as "official" as it gets. ... [your newsreader munged the indents here,... - Sat, Oct 30 2004 9:47 am 7 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/88cb533585cafed4 derangement: coding review request - 3 new ---------------------------------- ... This follows K&R and might have advantages of which I am not aware. A disadvantage is that it uses pointers, which are tough if you want the prog to be read by people who got their PhDs before the advent of the computer. ... I agree. ... Are you contending that the code doesn't work for some defined FAMSIZ < RAND_MAX? ... Now I'm truly confused. But I have to post and run. MPJ ... - Sat, Oct 30 2004 10:56 am 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/63c5271ccb9149a Segmentation Fault... - all new ---------------------------------- I knew I was doing something wrong. I had been working on other functions in the code for way too long, and let this one get to me. :) Here is what I ended up with, and it works as expected. .. static int get_command_args(char * msg, char *args[]) { char *p; int i = 0; p = args[i]; while(*msg && !( *msg == END_CHAR)) { if(*msg == ARG_CHAR) { ... return i++; ... static int parse_command(int sock, char *msg) { char *args[BUFFER_LEN]; if(get_ command_args(msg, args) == -1) return -1; /* Put the rest of the code here. */... - Sat, Oct 30 2004 3:47 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f59048347b785c0b pointer array question - 3 new ---------------------------------- Sorry for the rookie question.... If I have a pointer array (for example): char *colors[] = { "blue", "green" ... and I want to add yellow to this array later in my code....how would I do that? Thanks! ... - Sat, Oct 30 2004 4:06 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1c7bd85f3ba939b1 Confusion with C Part II - 2 new ---------------------------------- Thanks to all. I find this code in obfuscated context :) Another question : is there any problem/algo/whatever that use this sintax and that can not be written with (let say) normal array subscription? ... - Sat, Oct 30 2004 4:08 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4b902db955c715bb URGENT: Need help in setting environment variable.. pls help - all new ---------------------------------- Thanks for the help, but I was unable to get into themicrosoft link as the URL is not available. I am working with Visual Studio.NET , so I am pretty sure there is a way to set the environment, which I do not know of yet. If anyone has done something related in Visual Studio.NET, please let me know. Thanks, Rahul Shingrani ... - Sat, Oct 30 2004 4:15 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7b046388537281fb I can take it deep - all new ---------------------------------- Young 30's loud-mouthed Wiccan with a shitty attitude and general contempt for apathetic, Lexus-worshipping, stuck up Republicans seeks same or younger GWF for obnoxious fun times. I am a versatile, uninhibited gal who loves sex outside in the woods, in the dirt, in the mud, in the yard, on the hood of your mother's car and, sometimes, the occasional rubbish bin. Oh yeah... I'm into loud noises while doing it. There's nothing like scaring the horses, or the neighbors. I'm not a '10' and am not seeking one. In... - Sat, Oct 30 2004 2:44 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3e6f33a9175539f3 dynamic allocation - 6 new ---------------------------------- I need to implement these functions: void *malloc(int size); void free(void* p); using the functions below: void* malloc_os(int size); void free_os(int size, void* p); the problem is that free_os can free only the exact size of memory which was allocated to p by malloc_os. my idea was to define a struct, and for each allocation, the number of bytes allocated to the pointer, will be saved in the struct. struct ptr { void* pointer; int size; ... the implementation should be as follows: void* malloc(int size) { return malloc_os(size);... - Sat, Oct 30 2004 4:58 pm 6 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c86ae177cb7dd736 C... Why not c++? - 7 new ---------------------------------- Someone can exaplain me why use C instead C++? Until now i've never found exaplanation for this. Every project written in C on which i've worked could be written in c++, and when in nowadays happen still to see C code i really don't understand why the same things cannot be written in c++. Using c++ it's possble to reduce developing time achieving the same result. Can you give me a valid reason for C? ... - Sat, Oct 30 2004 5:30 pm 7 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/729e593ab5747942 Newbie Program That Started Off Easy - Simple Math w/ Interactive Menu - all new ---------------------------------- Hello, This program uses C. It is meant to convert whatever the current exchange rate is to dollars. It compiles, builds, and executes correctly except for a few bugs. When building I get an error that states; Linker Error (Severity 4) Module "a" in file "c:\program files\miracle c\yendollarext.obj" references unresolved external "_rewind" at offset 0303H in segment "_text". I am not sure how to resolve this error. Also, I attempted to have the program create an error whenever someone either "chooses" a number higher than 1 "else... - Sat, Oct 30 2004 6:52 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ddb89822e84f3152 file operations FAQ etc - 2 new ---------------------------------- I'm looking for some links or something that discusses opening files, writing files, and any gotchas associated with it. I'm new to programming and C so any pointers would be helpful. I know this is a generic question, but what I've found from googling shows stuff that I've already read on that leaves me skeptical as they use functions like scanf that from what I've seen, you're not to use. If anyone has helpful links, it would be most appreciated. I'd just like some ideas on checking whether a file already exists and baily... - Sat, Oct 30 2004 8:34 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/851e4fbe1f5911ae How To Send Http/1.0 404 Not Found Error Page In C - 2 new ---------------------------------- I have wrote a web server by C language. but I don't know how to send back error page to web browser if user type wrong web address or name that will show HTTP/1.0 404 NOT FOUND. One more is how I can stop server socket sending rubbish code if the requested files are sent competely. Thanks ... - Sat, Oct 30 2004 8:58 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fcb7349860eee21a shell quoting (was: Re: How to call a shell command within C?) - all new ---------------------------------- On 29 Oct 2004 07:28:04 -0700, ... There is another disadvantage: Security. Suppose you have a program that takes inputs from somewhere and uses them to construct a command to be run. Now, that you are expecting the input to be the name of the file and instead it's ";rm -rf /". That is, the actually command run would look like: system("cp source ;rm -rf /"); cp would bomb out with a "missing destination file" error (Assuming you're on UNIX) and then rm -rf / would trash your filesystem. (Again, assuming you're on UNIX. The attacker would,... - Sat, Oct 30 2004 5:50 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cd7d40b3c74475c9 ======================================================================= 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
