comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * What is an object? - 48 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a0f334cd4da25e1d * Problem with asm - 38 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/618a82c5f4d9722b * How to know the memory pointed by a ptr is freed? - 35 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/86b30ce6a4ba5b2a * Perl to C Converter? - 33 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2dc5b72e6416367f * How to take in a string of any size? - 32 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ff9065cd3c8a597b Active Topics ============= How to know the memory pointed by a ptr is freed? - 35 new ---------------------------------- ... The object ptr can be viewed in more than one way. After a call to free, attempting to view it as a pointer value invokes undefined behavior -- but you can still legally view it (as you can view any object) as an array of unsigned char. [...] ... An indeterminate value is either an unspecified value or a trap representation. You'd have to follow the maze of twisty definitions in section 3 of the standard to understand precisely what unspecified values and trap representations are, but basically it means that using... - Wed, Aug 18 2004 12:07 am 35 messages, 13 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/86b30ce6a4ba5b2a What is an object? - 48 new ---------------------------------- On Tue, 17 Aug 2004 15:28:19 -0700 in comp.std.c, "E. Robert Tisdale" ... To allow for implementation on Harvard architecture machines, in which instructions and data reside in separate address spaces, normally with the instructions unmodifiable and sometimes unreadable. Some of the PDP-11s on which C grew up supported separate I and D address spaces, allowing double the total address space without any additional address bits. References to code at address X referred to that location in I space, whereas references... - Wed, Aug 18 2004 12:39 am 48 messages, 14 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a0f334cd4da25e1d C predefined macros and portability - 6 new ---------------------------------- friends, Please go through the following code which I have downloaded from Bob Stout (Snippets): ... void main(void) /* Actually, void main( ) is non-ANSI/ISO */ { ... ... I have downloaded the above program which prints the specified compiler by which the code is been compiled. I have tested with MSVC and TC++, GCC. The out-put was exactly same as excepted. It throws "Unknown compiler!" for GCC. Even though the following code did use some of the non- ANSI standard specific can anybody explain the following:.. . - Wed, Aug 18 2004 1:19 am 6 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cb695cdb5caa334b macro with optional function calls and return value - 2 new ---------------------------------- Hi NG, I have the following struct, macro and functions prototypes: typedef struct { jmp_buf __env; /*other stuff*/ ... int smalloc_init_(SAT *sat_ p, size_t size); int ssetjmp_(SAT *sat_p, int sjval); The idea is that smalloc_init is called from an application. Then smalloc_init_ is called to initialise sat_p. If that fails it returns -1, and ssetjmp_ is never called. If it succeeds, it returns 0, and thus ssetjmp_ is called with setjmp((sat_p)- >__env) as one of its arguments. ssetjmp_ is basicly a wrapper around setjmp,. .. - Wed, Aug 18 2004 1:38 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/68fd787b0bb409eb set double array to 0.0 - 3 new ---------------------------------- ... Why not compare void* pointers? Is that in the C Standard? And what do you mean by 'object' in the expression 'pointers within the same object'? Are you thinking of segmented architectures? If so, yes, I assume a flat memory model so in that sense the code is system dependant. Without flat memory I think memcpy() would be faster than memmove(). Another assumption is that memory is byte-addressable. Note that the code was just meant as an example of how easily memmove()/memcpy() could be implemented (assuming byte-addressable flat. .. - Wed, Aug 18 2004 2:10 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/13531bdbb104fd99 How to explain "evaluate the expression as a void expression"? - 3 new ---------------------------------- ... This is the way I read that part: It starts off by talking about expressions that are of type void. For instance, an expression that calls a void function would be a void expression. If foo(k) is a void function, it's saying that you can't do something like: k = foo(k); (implicit conversion) k = (int) foo(k); (explicit conversion) But you can call: (void) foo(k); all day because you are allowed to cast a void expression to void. Nor could you do something like: k = (int) ( (void) i++ ); Since you took an expression having a type... - Wed, Aug 18 2004 3:47 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/77f92fe18e9b994 standards documents off-topic in comp.lang.c - 13 new ---------------------------------- ... You don't have to, it's well documented in the gcc man page. ... It is - Wall -O that is a good idea. -Wall fails to identify the usage of uninitialised variables if optimisation is not turned on and -W generates objectionable warnings (that's why its functionality was not included into - Wall in the first place). -W is fine for experienced people who understand the underlying issues and agree with them. Its diagnostics, however, could be confusing to newbies and lead them to break perfectly good code, in order to... - Wed, Aug 18 2004 3:48 am 13 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4c6b31ea3976587b Why index starts in C from 0 and not 1 - 5 new ---------------------------------- ... So does F77, IIRC, but the default is 1-based indexing. Dan... - Wed, Aug 18 2004 3:50 am 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6aadd2ee93c4283e c interactive graphical output - all new ---------------------------------- ... Still inaccurate. Just because a program refers to a function not in ANSI C, does not make it off-topic. Too oft the problem in a post has nothing to do the semantics of a library function, but with the C code around the call. int x; Q(x); x = 3; You don't need to know anything about Q to guess there's problem with an uninitialised variable. -- SM Ryan http://www.rawbw.com/~ wyrmwif/ I ASSURE YOU WE'RE OPEN! ... - Wed, Aug 18 2004 4:18 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4c98b3e7cc8ebd65 Objects and expressions - nitpicky questions - 18 new ---------------------------------- ... environment, the contents of which can represent values. When explaining this to students, is it reasonable to say something like: From a practical standpoint, objects are things that have addresses - addresses that can be computed. This doesn't necessarily mean that we can both read and write to that object - we may be able to do one, the other, or both (if we can't do either, it's rather pointless). So a string literal is an object. It is sitting in memory when your program is running. We can determine the... - Wed, Aug 18 2004 4:24 am 18 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/9f4b51d60051e2a7 Bad File Descriptor Error on strcat/strcpy - 5 new ---------------------------------- I need help trying to figure why this piece of code gives me a "Bad File descriptor error" everytime I try to run it and invoke fflush. This piece of code simple outputs a char string to the output stream. What ends up happening instead is that when outputting the first character string to the channel CG_ cdukeypad_CHA.Scrpad, its gives the bad file descriptor error, causing the char string not to output. When a second char string is received by the pointer and copied to the channel, the first character string appears... - Wed, Aug 18 2004 4:59 am 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4640b25c07f6afd3 vsprintf - safe alternative? - 4 new ---------------------------------- Hello NG, in my program I use the following function: void write_log(char * format, ...) { va_list arg; char txt[512]; // Get string va_start(arg, format); vsprintf(txt, format, arg); // TODO: txt might overflow va_end(arg); // Write to stdout if(debug_console) write_console(debug_console, txt); printf(txt); ... Is there any safe alternative to vsprintf? I do not want to change the way I am passing the parameters, because I used this function in thousands of code lines of a project I've been writing for two years now.... - Wed, Aug 18 2004 5:51 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5a53f38637788b0c macro containing include statement - 11 new ---------------------------------- Hello, I would like to construct a macro, which does conditional include of another source file. i.e. something like this: ... So that the body of the code can contain: MPIinclude("path/to/mpi_code/mpi_file.c") However, when preprosessing the macro definition above I get the following error message ( from gnu cpp): fphs.c:20:32: '#' is not followed by a macro parameter and the resulting code later fails in the eventual compilation. Is this possible? Joakim ... - Wed, Aug 18 2004 6:15 am 11 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/7f271f928f23282 Structures - 7 new ---------------------------------- I've written this structure and allowed the user to initialise the members in an array of this structure. I also want the program to print to the screen whats in this array after its been initialised. I've written the program below, but it doesn't do the last thing properly...any ideas? /*A program to allow user to populate an array structure*/ ... /*Declare a four member structure */ struct PayRecord {int number; char name[20]; float rate; int hours;}; main() { int i; /*Define an 1d array of struct*/ struct PayRecord employee[6];... - Wed, Aug 18 2004 6:56 am 7 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/edb397d618ad6a85 Is a function an object? - all new ---------------------------------- Thomas Gagne wrote in news:[EMAIL PROTECTED]: ... Yup. I have a fairly substantial numerical methods package (originally Smalltalk, now Java) that does function calculations, derivatives, interval calculations, statistics, blah blah blah, where functions are objects and practically everything else is done with the Visitor pattern. So roughly, if you have a function that is a "one-time" thing that belongs to another object, make it a method. But if you have a function that is ... - Wed, Aug 18 2004 7:22 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a0159e6b0a240573 use of serial and parrallel port using C - 22 new ---------------------------------- Hi All, What kind of commands can I use to control the serial and parallel port of my pc. I want to use my laptop instead of microcontrollers and write my software in ANSI C to be used for control purposes of sensors and other electronic devices. I haven't done any C for a while now so I would assume my knowledge is that of a beginner now. A thousand thanks for any help offered or intended. Naveed ... - Wed, Aug 18 2004 7:40 am 22 messages, 11 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/11b689b99a110935 Why is that? - 16 new ---------------------------------- I know what is causing the problem, but I couldn't find out why. ... main(){ int var; printf("Type a number:"); scanf("%d",&var); printf("The number is "); printf("%d",var); printf(newline); char *var2; printf("Type a string:"); int bytes_read=0; int nbytes = 100; var2 = (char *) malloc (nbytes + 1); bytes_ read = getline (&var2, &nbytes, stdin); if(bytes_read == -1) {puts ("ERROR!: invalid input");} printf("The string is "); printf("%s",var2); printf(newline) ; ... ... - Wed, Aug 18 2004 8:01 am 16 messages, 9 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2e0a5fda989aea50 POSIX and 8-bit bytes - 25 new ---------------------------------- ... Not necessarily on new POSIX platforms, even if the programs are otherwise free of implementation-defined behaviour. David Hopwood ... - Wed, Aug 18 2004 8:13 am 25 messages, 10 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4f3f5eabe4b12bce Rotate a array of char - 9 new ---------------------------------- Hi, Can you suggest me a (time) efficient way to "rotate" a array of char? In particular: - The array of char have a fixed (26) length - The array of char will not be modified in the code - The rotation is by only one char to the right side Example: array: abcdefghijklmnopqrstuvwxyz array after the rotation: zabcdefghijklmnopqrstuvwxy Thaks for all ideas ;) ... - Wed, Aug 18 2004 9:37 am 9 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3e34e0fb6d9e0cfc Advice on Project - 13 new ---------------------------------- Hello, This isn't exactly a C programming question, but i figured experienced C programmers would offer the best response. My boss wants a program developed that reads from ANY device(peripheral) over a serial/usb/tin can/etc. connection. I've tried convincing him it needs to be more specific (develop a driver for ONE device and go from there) but to no avail, I would like somebody else's professional opinion of why this is not attainable, or just comments/convincing arguments. Thank You ... - Wed, Aug 18 2004 9:41 am 13 messages, 9 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8abc8c41cb282ebf modf() - behavior - 4 new ---------------------------------- modf() is a C Standard Library function double modf(double x, double* ip); returns fractional part and assigns to *ip integral part of x, both with same sign as x I have encountere a situation that has me a bit confused on the behaviot of this function. When calling the function with a value that DOES NOT have a fractional portion - the integral part is no always what is expected. I have seen this on two compilers - and compiler used for an Hitachi SH* processor and MSCVC6.00 Here is a test program (MSVC6.00) that... - Wed, Aug 18 2004 9:46 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f4ac3fb0416f984 CHtmlView: How to read html text before display, change and give to display changed html code? - 2 new ---------------------------------- Yo! I design web browser in VC++. I need a web browser, in which I can display html in a litle changed form. The best control is CHtmlView with IWebBorwser2 (do you know other way?). But in CHtmlView i can't find methods to read html text before display, change it, and put in CHtmlView changed html text to display on screen. Do you know a method or way to read html text before display, and put in CHtmlView to display? Do you know other way to make Web Browser under Windows, without CHtmlView? Marek Kurowski... - Wed, Aug 18 2004 9:56 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b94ba2495b2558c7 Virtual keyboard - 2 new ---------------------------------- Hi I'm trying to make a virtual keyboard and having problems with the focusing and seeing to that the keyboard is always on top. If I don't care about the keyboard being on top and use the following method when I press a virtual key, just before generating the keyevent, the focus will (at least some times) be set to the right window and everything's fine. The window that had focus before I pressed the keyboard gets the keystroke. hwnd is the handle to the keyboard void resetFocusToLastOwner(HWND hwnd){ HWND hwndNext = GetNextWindow(hwnd,... - Wed, Aug 18 2004 12:55 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b6912d0ca7e79cb8 StrongARM processor EOF different? - all new ---------------------------------- Thanks guys, you're the greatest! Kirst ... - Wed, Aug 18 2004 5:33 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/3be6214ea11bf4fb libitery directory in gcc-3.1.1 source code package - 11 new ---------------------------------- ... How about this one? void* memcpy3 (register void* dest, register void* src, register size_t len) { void* pdest = dest; if( ((unsigned int) dest)%4==((unsigned int)src)%4 ) { ... { ... return pdest; ... Oh, I see.(I always think when I build GCC, it will automatically re-compile libc.) ... - Wed, Aug 18 2004 7:14 pm 11 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/68eaa453f5cdc387 how to pronounce 'yacc'? - all new ---------------------------------- ... ... Creeping senility... ... - Wed, Aug 18 2004 7:20 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8f8a34e6652f0b0b Newbie question about OSX - all new ---------------------------------- ... Yes. Using C interpreter Ch and you can just type the filename of *.c file from terminal and run it. Ch is free and available in Mac OS X. You can download it from http://www.softintegration.com/download/ ...... - Wed, Aug 18 2004 9:03 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e0e88559e5056b8d C Programer - 2 new ---------------------------------- Sir , I had picked up a project and having some difficulty . I am working on a project of designing a chip tester ,this thing will test just the basic digital chips like (7400 , 7408 , etc)hardware part is over in software part I have to send some singnals to the outside circuit and after lots of thinking I figured out that I can use printer port for this .But problem is that I was not able to figure out how to get it done in programe. How to interface the printer port .Is there any book that teaches interfacing... - Wed, Aug 18 2004 10:35 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b61b99cf8d7a69db Request for comments on HTML tag removal function - 4 new ---------------------------------- Hi All, Just writing a quick function to remove HTML tags from a string ( array of chars) and I'd like your comments on my code - anything you'd do differently or any mistakes etc. I'm still kinda new to C, so I'm not 100% confident using pointers yet. Anyway, the algorithm works like this: The loop steps over the string character by character with two pointers, I have a toggle variable that basically indicates whether the 's' pointer is currently within an HTML tag. If this is the case, 's' is incremented, but... - Thurs, Aug 19 2004 12:20 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/873e01d89ab8f0d1 Static Declarations - 15 new ---------------------------------- Hi guys, I have a few doubts in C. 1. Why static declartions are not allowed inside structs? eg struct a { static int i; ... Throws an error .. 2.How does the complier diffrenciate between a Global Variable and Static Variable as both of them will be in the same stack? Any pointers wud be helpful! Is there any book or site which gives details abt how the memory is handled for diffrent variables? TIA Anand ... - Thurs, Aug 19 2004 12:21 am 15 messages, 10 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1d0d0be00736203d C program for Fractal summarisation of document-help plz!!! - 2 new ---------------------------------- Can some one give me sample programs or links for creating a C program which will summarize a given word document based on fractal summarization and print the output to the monitor screen? The objective is I will pass the word document to be summarised and the out put should be a summarised version of the document fed in as input. I am new to this type of programs so need some help from you all. Advanced thanks for all your replys, Regards, s.subbarayan ... - Thurs, Aug 19 2004 2:12 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/698c1e0a98d7bfef function size - 2 new ---------------------------------- ... Dag many thanks for your explanation. ... - Thurs, Aug 19 2004 2:14 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/53f7f297af49ec07 test myself - 3 new ---------------------------------- Test and test and test ... - Thurs, Aug 19 2004 10:13 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c8daecc3afe895fc code review request: basic file I/O - 2 new ---------------------------------- ... But in general, I could just ignore /your/ code, write my /own/ code, release it as public domain, and get all the above benefits plus the benefit of free redistributability. :) (This approach breaks down for large projects where the work of contributing is less than the work of rewriting-from-scratch. But as I said, I refactored your program in a very short time, and could certainly write it from scratch in not much longer, if I did have aforementioned academic interest or charity. ;) Anyhoo, I'm sure we've all had this... - Thurs, Aug 19 2004 11:54 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4655bcdf5d86578c Line/word wrap program. - 9 new ---------------------------------- Here is a first attempt at a line/word wrapping utility. Seems to work okay, but lacks some checking stuff, etc. ... /* wrap.c inserts newlines in place of spaces according to specified line length. Output filename is {filename}. wrap. Takes two arguments, filename and line length. */ /* Todo: Need to figure out what sort of memory the larger files might need. File type checking? */ void wordwrap(FILE *ifp, FILE *ofp, char *wl) { ... char buf[ MAX]; int i, space, count, length; i = space = count = 0;... - Thurs, Aug 19 2004 1:59 pm 9 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/be08fefbcdcad794 cancel <[EMAIL PROTECTED]> - all new ---------------------------------- This message was cancelled from within Mozilla. ... - Thurs, Aug 19 2004 2:06 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/12cafd8da36a6677 Looking for a Chirp Function - 5 new ---------------------------------- Hello, I need to write a chirp function and was wondering if anyone has come across some code recently that has implemented a chirp? Thanks, joe ... - Thurs, Aug 19 2004 3:42 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cb1c2308c15d188e Is it possible to get the caller's name in C ? - 7 new ---------------------------------- and how to ? thanks for any help ... - Thurs, Aug 19 2004 4:12 pm 7 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a9a26ee68b808e70 Init before anything else - 7 new ---------------------------------- Hello, Consider this case: Init(params) does some initialization and there is a function Connect(params). The system starts and is idle until some one calls Connect, as soon as first Connection is received and only on first connection request Init() has to be called before serving Connection request. if(bInitialized) checks needs to be avoided as Connect() is invoked several times. Init & Connect prototypes are different. I have a solution, changing function pointers, any others??? Please suggest... thanks -Paul.... - Thurs, Aug 19 2004 7:50 pm 7 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4d217b0b340dc604 setvbuf - 3 new ---------------------------------- is using _IONBF with setvbf the general way of getting an unbuffered stream in a standardized way? or are system specific functions generally favored over c 89's setvbuf? ... - Thurs, Aug 19 2004 8:38 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f5ae0e883d23bb70 Help me with ur ideas for this project plz!!! - 3 new ---------------------------------- Dear all, I am not looking at this query from a C standard perspective,looking for some tips from application perspective of how this can be implemented in C. I am sorry if this group is not the right target for this query,in which case, I need your direction for the right target group for seeking help. Can some one give me sample programs or links for creating a C program which will summarize a given word document based on fractal summarization and print the output to the monitor screen?Or even other methods to summarize a document may also help... - Thurs, Aug 19 2004 9:33 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/eda3f4e44188374d Code blocks as macro parameters - 4 new ---------------------------------- Hi all. Is it possible to pass the whole blocks of code (possibly including " and ,) as macro parameters? I want to do something like: MACRO(FOO, "Foo", "return "Foobar";", "foo(); bar();") (just an example, obviously this won't compile) being parsed to: 1. P_FOO, /* Part of enum */ 2. "FOO", /* Part of string literal array */ 3. "Foo", /* Part of string literal array */ 4. case P_FOO: /* Part of switch */ ...... - Thurs, Aug 19 2004 11:22 pm 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/414ab559fb71a101 Is this OT(was:Re: "Eight Queens" program) - 6 new ---------------------------------- No body answered for the below question. Though i ma not the OP i wast to know weather it is a OT and guid me to the correct NG. (may be comp. programming ?) ... Subject: "Eight Queens" program From: [EMAIL PROTECTED] com (Matt) Date: 18 Aug 2004 03:32:17 GMT Newsgroups: comp.lang.c,comp.lang.c. moderated I will be grateful if someone explians this part ... of the code below. I don't understand how this marks the downward and upward diagonals. How does downfree[row-c+7] mark the diagonal? Regards, Matt ... typedef enum boolean_tag... - Fri, Aug 20 2004 12:13 am 6 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6c18e07401c5bc4e atoi error - 16 new ---------------------------------- How can I get correct result: char * str; str = "10974000000"; i = atoi(str); printf("i=" , i); ... i=2617245696 - If str is smaller(10974000) then result is correct ... - Fri, Aug 20 2004 6:10 am 16 messages, 13 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ff31b9ed99d28a98 OS/2 C60 programs converted into MS windows programs?Information on OS/2 C60? - 8 new ---------------------------------- Hello, all I am working on a project that needs to convert OS/2 C60 programs into MS windows programs. And I found it difficult to find useful information. Could somebody kindly help me ? any tips?web sites? 1. How can I convert OS/2 C60 programs into MS windows programs? 2.Where can I find information on OS/2 C60 ?any web sites...? 3. What are the difference between variable types in OS/2 and in MS windows? Any tips are appreciated. Coca ... - Fri, Aug 20 2004 8:18 am 8 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d49c2d9a30e92e20 Variable arguments - 2 new ---------------------------------- I am declaring a local buffer of a fixed size in my variable argument routine. How do I figure out the correct size of the variable argument list so that I can dynamically allocate the memory? void disp_message(char *szCaption, char * szFormat, ...) { va_list ap; char szBuffer[4096] = { 0 }; va_ start(ap, szFormat); vsprintf(szBuffer, szFormat, ap); va_end(ap); // Display the message. MessageBox(NULL, szBuffer, szCaption, MB_OK | MB_ ICONWARNING); ... ... - Fri, Aug 20 2004 8:49 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/411687bf2d8d0f0d C99 complex numbers and aliasing - 3 new ---------------------------------- ... Can you please explain why giving the "(double *) &d + 1" argument is any different from the "((double*) d) [1]" access? (No critism meant, really just asking). To me 6.5p6 sounds like memcpy too, only works on objects without declared type, i.e. you haven't the right to access it as a complex afterwards (does this imply that memcpy isn't doing any kind of magic behind the curtain which a simple loop could not do?). I wonder what I got wrong this time. These questions about basic-as-can-be operations really make me... - Fri, Aug 20 2004 8:50 am 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/4ab1361b22b47c33 sizeof struct returning unexpected results - 10 new ---------------------------------- I have a struct that I wrote to test a protocol. The idea I had was to just declare the elements of the struct in the order in which they are sent and received as defined by the protocol. However, writing this struct to a file produces unexpected results. ... struct Tester { unsigned short first; unsigned int second; ... Checking the sizeof variables declared to be of this type, I get 64 bits, when really the size of a short is 16 bits, and the size of an int is 32 bits. Declaring the struct to have... - Fri, Aug 20 2004 9:40 am 10 messages, 9 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8e8868084e375810 disregard: sizeof struct returning unexpected results - 2 new ---------------------------------- I perused the archives of comp.lang.c and found some answers related to addressability of struct elements (only in arrays?), and will probably proceed by using byte or char arrays filled with raw data and then converting to the expected types. Unless anyone has any helpful or enlightening comments, I will leave this issue closed for now. Thanks again for the time! ... - Fri, Aug 20 2004 9:54 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dd89c97daa5a3f8e syntax/notation used in describing c's grammar - all new ---------------------------------- In article <[EMAIL PROTECTED]>, Ben Pfaff ... ... cool. thanks for the info. ben. ... - Fri, Aug 20 2004 12:38 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f485582dfe3def0b Is there any system shutdown code in C From DOS ? - 9 new ---------------------------------- plz i need the code? bye, ... - Fri, Aug 20 2004 12:57 pm 9 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b3ee4d4724b822f6 Associate argument with entry in header file - 9 new ---------------------------------- All, We want to associate a argument with a corresponding entry in header file. How do we do this? The argument is defined in a header file. We want to extract the value of the #define variable. For example, ... Checkheader.c ... int main(int argv, char * argc){ ... We should be able to run Checkheader VARIABLE and it should return 10. Thanks in advance, Shekar ... - Fri, Aug 20 2004 1:54 pm 9 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/74a3cd66aa85ce69 reading com port - 5 new ---------------------------------- Hello I am connecting a device to one of the com ports. could some one help in getting some code to communicat with a device and read its status I am sure there some code around... gest regards wayne ... - Fri, Aug 20 2004 2: 51 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/72f6df6d28b09edc html parser - 2 new ---------------------------------- Hi all I am using libcurl to grab an html file from a remote http site. How can I parse this file in order to produce a "formatted" output? Is there any lib around that performs this action? Thanks... - Fri, Aug 20 2004 5:32 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fc0631be5de3e8d7 "Eight Queens" program - 6 new ---------------------------------- ... I sat down, with a piece of paper and pencil. Draw out a chess board ( eight by eight squares obviously, colour doesn't matter, so all white :-) ). Also draw out three columns of squares: one eight deep, and two fifteen deep. The three columns will represent colfree, upfree and downfree. Assume if their entries are blank, they are true. Mentally, step through the program. So, entering AddQueen, row++ makes row=0. For col=0... If... all statements initially are TRUE, so we execute the contents of the if statement: colfree[0] = FALSE (mark this... - Fri, Aug 20 2004 9:12 pm 6 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d30c2914a33da7bc (no subject) - 9 new ---------------------------------- ... Is tying up our download withs 1600 odd lines of this really needed? ... - Fri, Aug 20 2004 9:30 pm 9 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/11041c7c9eec66e7 HELP with Programming USB needed - all new ---------------------------------- ... Or the fourm at www.usb.org ... - Fri, Aug 20 2004 9:33 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/35a95cc88d71551e CGIs for Linux Web Server but Windows PC for developing - 4 new ---------------------------------- Hi all there, I want to develop in C a couple of CGIs to be uploaded on a Linux Web Server. Unfortunately (or fortunately, just a question of points of view), I use a classical Windows 2k/XP PC to locally develop/debug the software. I'm wondering if any of you can suggest a good C cross compiler I can use to locally develop and test on a Windows platform and upload a proper binary code on a Linux platform. Many thanks. Regards, Irena ... - Sat, Aug 21 2004 4:54 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/16e7f3cc45047836 any good - 8 new ---------------------------------- posted by ash4640 These question posted 15/8/04 How do I write these programs in c I am a beginner learning c. 1. write a program to read 2 inetegers with the following signficance the first integer value represents a time of day on a 24hour clock, so that 1245 represents quater to one mid-day for eg. The second integer represents a time duration in a similar way, so that 345 represents three hours & 45 minutes. This duration is to be added to the first time, and the result printed out in the same notation, in this case... - Sat, Aug 21 2004 6:06 am 8 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/aa68eac47d6a13c4 Accessing a global variable when there is a local variable in the same name - 7 new ---------------------------------- In article , ... I may or may not qualify as a regular, but I read this NG with a "technical content" filter - i.e., it filters out any extraneous technical content. I read this NG for the abuse (it is so much fun) - and I'd imagine that is true for most of the regulars. Surely, we all know about as much C as we need to, so there's not much point in reading this in the hopes of learning. Reading for abuse is so much more entertaining. ... - Sat, Aug 21 2004 11:07 am 7 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fa2631e04963cddb walking through an array of char pointers - 20 new ---------------------------------- I can't seem to get this to work: ... int main() { char *names[3]; char **np; names[0] = "jack"; names[1] = "jill"; names[2] = "zack "; while (**np != '\0') { ... return 0; ... after printing the 3 names, it prints garbage then sometimes seg faults. I know i can do it easily using a for loop, but that's not what I am looking for. I was under the impression names is actually: [] --> "jack\0" [] --> "jill\0" [] --> "zack\0" [] --> \0 If, that is so, shouldn't I be able to perform the above loop?... - Sat, Aug 21 2004 11:22 am 20 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9cb0acf0ee1cec Wrap program revised. - 6 new ---------------------------------- Back for more critique. ... /* wrap.c inserts newlines in place of spaces according to specified line length. Output filename is {filename}.wrap. Takes two arguments, filename and line length. */ void wordwrap(FILE *ifp, FILE *ofp, char *wl) { ... length = atoi(wl); for (i = 0; i < MAX && ((c= getc(ifp)) != EOF); ++i) ... if ((i == 0) || ((buf[i] == '\n' || buf[i] == '\ t') && buf[i-1] == '\n')) count = space = 0; if (buf[i] == ' ') space = i; ++count; if ((count == length) && (space != 0)) {... - Sat, Aug 21 2004 1:35 pm 6 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ea20e8d361e04604 Perl to C Converter? - 33 new ---------------------------------- There's this utility called html2ps that's written in perl, but the box I want to run it on doesn't have room for perl. It does have room for a C compiler. Be nice if I could find a tool that converted perl to C. Thanks in advance for any help. (running debian linux here) AC ... - Sat, Aug 21 2004 7:17 pm 33 messages, 12 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2dc5b72e6416367f Pointer Declaration/Array definition - 13 new ---------------------------------- Why does this declaration give undefined result: file1: extern char * p; file2: char p[10]; Let's assume p has been initialized, now accessing p[i]... ... - Sat, Aug 21 2004 10:24 pm 13 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d386b7e8e919534b ANSI C problem on P4 under Linux & Windows - 7 new ---------------------------------- I have an ANSI C program that was compiled under Windows MSVC++ 6.0 (SP6) and under Linux gnu, and ran under P3, P4 and AMD. It runs fine on P3 and AMD under both Windows and Linux, but under P4 it has problems. Under Windows 3 GHz P4 runs twice slower than 800MHz P3... and under Linux not only that it runs slower (while AMD is 40 times faster), but it also produces wrong numerical results... Any suggestion what can be the problem? How to fix the P4 speed under MSVC++ (SP6)? How to fix P4's speed and numerical result... - Sat, Aug 21 2004 10:42 pm 7 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/25d542b377df46bd How to take in a string of any size? - 32 new ---------------------------------- Do I have to use char * string and then malloc memory to it? But malloc(size) can only gurantee that size is allocated. What if the string is more than size? Is there any way to find the size of the string before taking it in and THEN malloc the needed amount? I'm in a rut, help me please :( ... - Sun, Aug 22 2004 12:42 am 32 messages, 14 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ff9065cd3c8a597b array of pointers to a structure - 2 new ---------------------------------- struct name { char ch; ... If this is my structure and if i need to store the address of the pointers ptr1 and ptr2 in an array say "del"..how do i do it? is it right if: struct name { char ch; ... and in the main: del[0]=ptr 1; giving me error--it says teh subscripted value is neither an array nor a pointer!!! ... - Sun, Aug 22 2004 2:13 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f7ac274c3b21346d c/pascal compiler differences - 17 new ---------------------------------- Hi, I think I understand now a bit better what the difference is between a c compiler and a pascal compiler. For example: When compiling source code with a pascal compiler. The pascal compiler will simply stop when it is missing an implementation for a procedure or whatever. The c compiler however will simply continue compiling even if the implementation for the headers/ prototypes are missing. The c linker will then report a big list of link errors. Both methods have benefits and drawbacks. The pascal compiler is more. .. - Sun, Aug 22 2004 5:21 am 17 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b046b90f5c780284 Double pointer and 2D array - 6 new ---------------------------------- I have a double pointer and a 2D array: int mat[5][5], **ptr; ptr = mat; mat[2][3] = 3; Although mat and ptr are pointing at the same address, &ptr[2][ 3] and &mat[2][3] are not, why? I know ptr[2][3] dereferences the resulting object two full time which will have the address of whatever content that is at [2][3] rather than the address TO [2][3] but I can't figure out why? Thank you. ... - Sun, Aug 22 2004 8:52 am 6 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/41f099f6915e7592 Static variables. - 4 new ---------------------------------- Isn't a local static variable assigned to a memory area that is neither on the stack and not part of the normal heap? That's how the local static variable can be used to remember state within a function between calls to the function. Also, since C never had anything like namespaces, global static variables where one way to control name collisions: that is one of the reasons for developing C++ and other OO languages in the next generation. SCF ... ... - Sun, Aug 22 2004 10:16 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6422723cdc4c3306 Sample Function / Random Permutations (newbie) - 2 new ---------------------------------- Dear all, I am looking for a function in C which does the following: After giving an array of n integers ranging from 1 to n, the function should return a random sample of size k (k <= n) without replacement. This is similar to take a random permutation of that array and then choose the first k elements. Some code example might clarify what I mean. In R and S-Plus, the command would be: sample(x=1:n, size = k, replace=FALSE) In GNU Octave it would be ( probably the same then in Matlab): randperm(n)(1:k) In Python, the command would be:... - Sun, Aug 22 2004 10:58 am 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/98a336a613c4e21c Problem with asm - 38 new ---------------------------------- Hello! I got the following Code in Assembler (NASM), which prints out "5" in realmode: mov ax, 0xB800 mov es, ax mov byte [es:0], '5' I want to do the same in gcc now, but I'm stuck. GCC doesn't like the [es:0] syntax... asm(" mov %ax, 0xB800"); asm("mov %es, %ax"); asm("mov [%es:0], '5'"); <-- Error about "[" :-( Can anyone help me how to do this? Or can I also do this directly in C with pointers and don't use the asm() at all? I couldn't get this to work either... Thanks for any help! Patrik ... - Sun, Aug 22 2004 12:28 pm 38 messages, 15 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/618a82c5f4d9722b Welcome to comp.lang.c! - all new ---------------------------------- Welcome to comp.lang.c! This post is intended to give the new reader an introduction to reading and posting in this newsgroup. We respectfully request that you read all the way through this post, as it helps make for a more pleasant and useful group for everyone. If you are new to newsgroups in general, you can learn a lot about how to get the most out of newsgroups by reading the links below: ... With that said, please keep in mind that comp. lang.c is a group for discussion of general issues of the C programming language, as defined... - Sun, Aug 22 2004 9:43 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/c7812bb9d36be91f Is any self reproducing code in C ? - 4 new ---------------------------------- hello experts , ... Condition is that instead of there is no .c file in same path the .exe file itself prints the output of source . Waiting for the best reply , bye, ... - Mon, Aug 23 2004 9:24 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ae05f4a0ef63a13b wants source code of shutdown in C using interrupts ? - 10 new ---------------------------------- hello, Is there any code using interrupts . bye ... - Mon, Aug 23 2004 9:26 am 10 messages, 7 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fb39debba991cb6e C source code of award winning of world map which site helps ? - 4 new ---------------------------------- hello, ... ... - Mon, Aug 23 2004 9:28 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d5d5a59b4f56aa02 perfect hashing - 5 new ---------------------------------- hello folks, do you have any idea how gperf generates the numeric table ? I know that it uses perfect hashing for speeding up look up. any link, trick will be really very appreciated thanks in advance ... - Mon, Aug 23 2004 2:07 pm 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/22c937c9948edc86 cast-as-lvalue - 8 new ---------------------------------- I recently upgraded my Arch Linux system to GCC 3.4, and found out that a previously accepted behavior (cast-as-lvalue) is now marked as deprecated, and will cease to function in GCC 3.5. This has caused several builds to break, most notably elfutils. Presumably this behavior is not part of the C standard and it is thus being excised like many other nonstandard GCC extensions. Regardless, my question is not about the specifics or politics of GCC or any compiler. Much of the code I'm trying to fix involves... - Mon, Aug 23 2004 3:21 pm 8 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a35940b06b60c848 gcc's nutty Nethack object code - 5 new ---------------------------------- A few months ago I attempted to compile an old version (3.0j) of Nethack. Once I got a few modules to compile I disassembled the code of the shortest and am puzzled by a couple of things. 1. Where the C code calls for an operation that algebraically is (x - 19) * 10,000,000 [i.e. "return ( 10000000L*(lev-19));"] gcc generates code which algebraically is ((x - 19) + (x - 19) * 31 * 63 * 8) * 5 * 128 and I'm wondering at such a roundabout method. See the attached code, especially the disassembler listing at offsets. .. - Mon, Aug 23 2004 4:19 pm 5 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5cac71c997e66fd9 Problem about mmap()! - 5 new ---------------------------------- Hi everyone! I found that if you want to write to the memory got by mmap(), you have to get the file descriptor for mmap() in O_RDWR mode. If you got the file descriptor in O_WRONLY mode, then writing to the memory got by mmap() will lead to segmentation fault. Anyone knows why? Is this a rule or a bug? What if I just want to write to the file and nothing else? Please, look at my tiny program, I wrote this to test mmap(), it is cute. ... typedef struct{ char name[4]; int age; ... int main(int argc, char** argv) {... - Mon, Aug 23 2004 6:52 pm 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/937d235b277ff365 Problem about glibc2.3.3 mmap()! - 2 new ---------------------------------- Hi everyone! I found that if you want to write to the memory got by mmap(), you have to get the file descriptor for mmap() in O_RDWR mode. If you got the file descriptor in O_WRONLY mode, then writing to the memory got by mmap() will lead to segmentation fault. Anyone knows why? Is this a rule or a bug? What if I just want to write to the file and nothing else? Please, look at my tiny program, I wrote this to test mmap(), it is cute. ... typedef struct{ char name[4]; int age; ... int main(int argc, char** argv) {... - Mon, Aug 23 2004 6:54 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dd78083eb8a57bb8 C++ wins over C !! - 23 new ---------------------------------- See this post, C seems to be loosing here Are we still programming in C, just b'cause those mortals find it easy to develop a C compiler than C++ compiler. Considering C++ can do every thing that C can and Vice Versa is not true. then why C? I personally like C, C is good but C++ is great. http://groups.google. com/groups?hl=en&lr=&ie=UTF-8&newwindow=1&safe=off&threadm=d8b1e3e6.0408191850. 1905d0ce%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF- 8%26newwindow%3D1%26safe%3Doff%26selm%3Dd8b1e3e6.0408191850.1905d0ce%2540 posting.google.co... - Mon, Aug 23 2004 7:58 pm 23 messages, 20 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2496e069f9974a58 how do I get content of clipboard on linux - 2 new ---------------------------------- I am using KDE on linux ( Redhat AS3 ). Is there a library that can give me the contents of the clipboard Thanks Ram ... - Mon, Aug 23 2004 10:09 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/74e407eef6c54a85 Function PLzzzzzzzzzzz - 9 new ---------------------------------- 1.Guys how do i write a function similar to the strcmp() in the library like some xstrcmp(). 2. How do i write another function eg x() which compares two strings const char *string, const char *strSearch ie *string="Hai hello" * strSearch="ai" I have to search for ai in the string "Hai Hello" and then return "ai Hello" if found or return NULL if not found. Hope You can guys can help out a newbie if you cannot get me the whole func get me some prototype atleast so I can work it out. Also try to get me the first strcmp() func. ... - Mon, Aug 23 2004 11:24 pm 9 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/83f1ab81c524eec1 Optimisation techniques - all new ---------------------------------- ... You still @ picsel? ... - Tues, Aug 24 2004 4:30 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/1ee2a8f47ac725c9 undefined reference to `__gxx_personality_sj0' - 4 new ---------------------------------- Hi, I'm seeing this problem when i try to compile my code. I did a lot of googling before posting here. I read that my Library Path may not be set right. but, I get this error even after setting my library path correctly. Just to confirm, what should the Library Path include to solve this error. Is there any other area that i should be looking into to solve this. Thanks in Advance, Sunil Kumar K ... - Tues, Aug 24 2004 4:42 am 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dc39743ceaed921a is there config file analysis code can be read? - all new ---------------------------------- hello everyone: I wanna write a fucntion to analyze the configuration file httpd.conf of Apache. I just constructed a global list data type, in it I can have node like this: /**************************************************** *********** typedef struct KEY_VALUE{ char *key; char *value; ... typedef enum {ATOM, LIST} ElemTag; typedef struct GLNode{ ElemTag tag; // tag "base node"(ATOM) or "sublist"(LIST) KVPair atom; // element value struct GLNode *head; // point to first node of the sublist; NULL if empty... - Tues, Aug 24 2004 5:35 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/56d80c77fd4edfa5 ccide: C Language Decision Table Code Generator - all new ---------------------------------- CCIDE reads your C program source and expands decision tables with supporting C code. See http://sourceforge.net/projects/ccide for downloads and more. See the CCIDE Home Page at http://www.ccide.com for FAQs, Examples, and Man page. Try it! ... - Tues, Aug 24 2004 1:12 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6e6875e64aba041 function redefined problem - 8 new ---------------------------------- Hi, In my project , I has to include a head file "alloc.h". The malloc() function was wrapped in this file as : alloc.h ... alloc.c void *PROJ_MALLOC( size_t a){ ... So that everytime I use malloc() it will be invoked to PROJ_ MALLOC actually. My question is how can I use system malloc() and avoid using PROJ_MALLOC ? Thanks! Wei ... - Tues, Aug 24 2004 5:52 pm 8 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/f9ad46a0f27bd81f Newbie Question about #ifdef - 3 new ---------------------------------- I came across some code that had this in it: ... lseek( d, offset, SEEK_SET ); read( d, buf, nbytes ); ... I wondered if the lseek and read methods ( with these method signatures) are standard, or would this code be looking for a dll? I was thinking of trying to build this function in Java, but if it's going to depend on a dll for which I do not have the source, that would stop me in my tracks. --Dale-- ... - Tues, Aug 24 2004 6:21 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/590a95e41276f91c Wrap rev 2. - 3 new ---------------------------------- Back again for more critique... <grin> ... /* wrap.c inserts newlines in place of spaces according to specified line length. Output filename is { filename}.wrap. Takes two arguments, filename and line length. Done: Checks file handling, argument parameters, file type, and word/line length comparison. Todo: Need to figure out what sort of memory the larger files might need. */ void close(FILE *fp1, FILE *fp2) { fclose(fp1); fclose(fp2) ; ... int wordwrap(FILE *ifp, FILE *ofp, char *wl) { ... length = atoi(wl);.. . - Tues, Aug 24 2004 6:32 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/39399d219983b605 memset - 5 new ---------------------------------- Hi, Let say I have: char szBuffer[20]=""; 1. Which one is the better option to reset the buffer ? and why? ... 2. Can I use just memset(...) ONLY ? Instead of strcpy(...) memset(...) ? Thanks ... - Tues, Aug 24 2004 7: 09 pm 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cd28bd5356634d20 how to use the keyword extern in c? - 2 new ---------------------------------- hi all , anyone could tell me the useage of the keyworkd "extern" in c? and the difference between c & cplusplus? in the C99Rationalv5.10.pdf it lists 4 cases. while the first common cases will incur the vc compiler to complain. . .. - Tues, Aug 24 2004 7:15 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dcb9f322acf697ba is there a better way to optimise this code - 6 new ---------------------------------- Hi, I am writing an application where I look for a white pixel by testing if all the R,G,B values are 255 i.e. I use if(RGB[0] == 255 && RGB[1] == 255 && RGB[2] == 255) (assuming RGB is a pointer to unsigned char) This statement gets executed for all the pixels in a page, so if I can find a better way to do this, I could potentially save a lot of cpu cycles. I would greatly appreciate any feedback ... - Tues, Aug 24 2004 9:35 pm 6 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/685473da7d61132e sys WIN32 - all new ---------------------------------- hi all... Shall i know if there any greate books that talk about "windows system programming" for beginners and others for "writting device driver for win32 system"/using C/C++/Assembly ; I have done my best for looking such a book. THANKX ALL ... - Tues, Aug 24 2004 10:45 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2bc4d29cd09b1a4b Techniques for reducing code size? - all new ---------------------------------- I already know some techniques for writing small footprint software, but now I need to really squeeze the software I'm writing into a small space (embedded software). Is there a good web page that discsuesses techniques for this? A good book? /Martin ... - Wed, Aug 25 2004 12:28 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/a9aba5553bd103d3 ======================================================================= 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 ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar. Now with Pop-Up Blocker. Get it for free! http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/BCfwlB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/kumpulan/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
