comp.lang.c http://groups-beta.google.com/group/comp.lang.c
Today's most active topics: * Pointers in c - 12 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fa61be9ea4fe3db1 * detecting memory corruption - 8 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/879fd7c0feaac206 * C call of a C# dll - 6 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9923bd86ab96f4 * Call function address stored in type of size_t? - 5 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6d2c8e898569aa31 * Language efficiency of C versus FORTRAN et al - 4 new http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d2a96d38c42413 Active Topics ------------- Given an array a[N] with value 1...N, find a repeted value - 2 new ------------------------------------------------------------------ [EMAIL PROTECTED] wrote on 25/12/04 : ...No, because the valid indexes are from 0 to N-1. That fixed, yes, there is a solution (maybe more). Just write it and submit here for an expertise... - Sun, Dec 26 2004 10:32 am 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/df88efab84cf30ee 2 dimensional strcpy err - 1 new -------------------------------- Ross wrote on 25/12/04 : ...First of all, be sure you are using a C compiler. The file extension should be .c (lowercase) and not .cpp or .C (uppercase). - Sun, Dec 26 2004 10:37 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/426dd4ab4b5d92ee scanf in a for loop - 2 new --------------------------- sachin wrote on 25/12/04 : ...No. Please, read the FAQ. - Sun, Dec 26 2004 12: 15 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/aebc3f924a267595 Text editor data structures - 4 new ----------------------------------- SD wrote: ...soon. ...be ...Asking what data structure to use witout any context of what exactly you want to use it for is not likely to get you a very good answer. You probably need to spend a little time doing some design and determine what types of things you need different data structures to do. Do you - Sun, Dec 26 2004 7:37 am 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/eef825317a6e56d0 C call of a C# dll - 6 new -------------------------- ...Yes, so I gather. - Sun, Dec 26 2004 6:23 pm 6 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/5e9923bd86ab96f4 detecting memory corruption - 8 new ----------------------------------- Hi, I was recently asked to write a function in C that would detect if memory is corrupted. I had no clue about the solution but what I believe is that the solution is not complicated. Does anybody know how to write such a function? Regards, Prabhat - Sun, Dec 26 2004 11:14 am 8 messages, 6 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/879fd7c0feaac206 Pointers in c - 12 new ---------------------- I have programmed a library which offers an API which takes both 'const char*' and 'char**' pointers as input parameters. An example: extern int apicall( int sessioncontext, const char* input, char** output ); This method will use the input data, do some processing, allocate memory - Sun, Dec 26 2004 8:20 pm 12 messages, 8 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/fa61be9ea4fe3db1 Coding [style] standards - 2 new -------------------------------- First I want to mention that I have read all the responses in this thread, I just don't have time to respond to them all. Thanks to those who have replied. More below: ...I'm trying not to be. There are things that I like that I can give objective reasons for liking. For instance, I don't like K&R brace style. I like for - Sun, Dec 26 2004 2:23 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/45fff8e456da3b6e Call function address stored in type of size_t? - 5 new ------------------------------------------------------- On Sun, 26 Dec 2004 05:52:11 GMT, in comp.lang.c , Keith Thompson ...It does however say what happens to local objects, and inc() is one of those, more or less. ...It might - the compiler might do the same it does with local variables, which /do/ 'go away' when the function ends. - Sun, Dec 26 2004 8: 01 pm 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6d2c8e898569aa31 Find the intersection of two rectangles - 1 new ----------------------------------------------- Assume : Rect A and Rect B. Upper Left(ul) and Lower Right(lr) co-ords are given. The following function will return true if they intersect. int areIntersecting(Rect A, Rect B) { return ( ! ( (A.ul.x > B.lr.x) || (B.ul.x > A.lr.x) || (A.ul.y < B.lr.y) || (B.ul.y < A.lr.y)) ...You can obviously use DeMorgan's law to remove the negation operator. - Sun, Dec 26 2004 1:57 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/99df99b55008f836 Welcome to comp.lang.c! - 1 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 - Sun, Dec 26 2004 5:20 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/b5d6f882e235ed70 serial port communication (linux) - 2 new ----------------------------------------- ...Well, for starters you are using a file pointer of type FILE with read() system call. The read() system call uses a *file descriptor*. If you used fread() instead you might get a better result. Besides, read() is a UNIX system call and has nothing to do with the C language. - Sun, Dec 26 2004 11: 22 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/688d852381a593ea Gaussian random number generation in C? - 1 new ----------------------------------------------- On 22 Dec 2004 12:16:27 -0800 ...<snip> ...<OT> If your firewall at work allows it I suggest using the news feed provided by these people [link] It's free and good quality. </OT> - Sun, Dec 26 2004 11:38 pm 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/e8860449f02d0a3c Job Prospects for Software Engineers - 3 new -------------------------------------------- I wonder if the job and salary prospects for CS majors and Software Engineers are really bright. [link] Please discuss. - Sun, Dec 26 2004 5:10 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d4d51fed78597aa9 is NULL-checking redundant in accessor-functions? - 1 new --------------------------------------------------------- Mikhail Teterin wrote on 25/12/04 : ...I didn't : char *getName (const MY_TYPE *this) { char *s = 0; if (this != NULL) { s = this->name; } return s; ...Who knows? The standard says that dereferencing a NULL pointer invokes an undefined behaviour. It may crash or not. ...Now, you know better what an undefined behaviour is. - Mon, Dec 27 2004 1:07 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/ebab70360231d48a Detect direction of stack growth - 4 new ---------------------------------------- Hi all, Is this a (C99) portable way to detect whether the C stack grows upwards (1) or downwards (-1)? ...int stack_direction=0; void detect_stack_ direction(void * stack_start) { void * stack_current; stack_direction=-1; if (& stack_start<&stack_current) stack_direction=1; ...int main() { void * stack_ start; - Mon, Dec 27 2004 2:47 pm 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/36293757e89add3a Language efficiency of C versus FORTRAN et al - 4 new ----------------------------------------------------- Hi, I have read somewhere that C code sometimes cannot be compiled to be as efficient as FORTRAN, eg for matrix multiplication, because a C compiler cannot make the assumptions about arrays that a FORTRAN compiler can. But I don't understand the example, not least because I don't understand FORTRAN. I also don't understand why it is more - Sun, Dec 26 2004 5:52 pm 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/d2a96d38c42413 Problem regarding sum of digits of floating point number in C - 2 new --------------------------------------------------------------------- hi there, recently i have got a problem regarding calculation of sum of digits in a floating point or precision number. the weird behaviour of compiler/ language is preventing me from calculating the sum of all digits. the compiler doesnt store the number as given by the user. some of the precision digits are lost or changed (at will!). so by any - Sun, Dec 26 2004 5:58 pm 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/83a22f78748f3c86 Is there a library function for placing cursor position in the cosole? - 1 new ------------------------------------------------------------------------------ On 15 Dec 2004 04:33:27 GMT, [EMAIL PROTECTED] (Gordon ...Not officially, but practically the little ribbon-guide thingies functioned well enough to let you position the carriage w.r.t. something on the paper, or more often vice versa. (On any model 33 of course, not just ASR which is irrelevant to the print mechanism.) - Mon, Dec 27 2004 4:34 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/8777a782cb1bc23c Why does ANSI not define a function to determine the size of (m)allocated mem? (like _msize) - 1 new --------------------- On Sat, 18 Dec 2004 18:06:16 +0000, Chris Croughton ...Fortran 90 and up (F9X) for arrays (bounds), and for character strings (length) which Fortran like COBOL and PL/I considers a separate type, not just array of character as in C, Pascal, and Ada (sort of). But it does so by having fat pointers. Very fat pointers. Obese, even. - Mon, Dec 27 2004 4:34 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/6e3da9ee177164ac reading text files - 1 new -------------------------- ...caught, so for the record: <snip> ...<snip> ...Safe; getchar/fgetc/getc value != EOF is valid unsigned char. <snip> ...Unsafe: plain char may be signed and input values might be negative; use isalpha( (unsigned char)c ), or just make c unsigned char to start with. Sorry. <snip> - David.Thompson1 at worldnet.att.net - Mon, Dec 27 2004 4:34 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/72b80e3923ec8004 2D arrays and malloc - 1 new ---------------------------- On Fri, 17 Dec 2004 23:10:18 +1100, Erik de Castro Lopo ...<snip> ...<snip> ... <snip> Yes. You don't need the standard; see FAQ 6.16 et seq at usual places and [link] . The pointer to (allocated) pointers to (allocated) elements isn't actually a 2D array at all, but a 2-level structure that can be - Mon, Dec 27 2004 4:34 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/2ac370658c22bd72 Is there any GENRIC MACROS in c for INTEGERS,CHARACTERS ? - 1 new ----------------------------------------------------------------- On Tue, 21 Dec 2004 07:00:50 GMT, Keith Thompson <[EMAIL PROTECTED]> wrote: <snip> . ..The former does. The latter gives you isdigit( USHRT_MAX+1 -23 ) where USHRT_ MAX is at least 65535 and thus way out of the range of 8-bit unsigned char which is 255. The other safe form is isdigit( * (unsigned char*) &s[i] ) . - Mon, Dec 27 2004 4:34 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/cafd52e524781b8e Macros that break compiler headers - 1 new ------------------------------------------ On Tue, 21 Dec 2004 11:36:23 +0000, Lawrence Kirby ...<snip: #define'ing keywords > ...Sorry, but I think it has to be limited to phase 7 & 8 because only then are _tokens_ distinguished into keywords and identifiers; before that you just have identifier(ish) pp-tokens. 6.4p3; 6.4.2.1p4. ...No comment on juxtaposing the concepts 'sensible' and 'IOCCC' :-) - Mon, Dec 27 2004 4:34 am 1 message, 1 author http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/dddf88911f2ac26f memory alignment - 3 new ------------------------ Hi, What is the concept of memory alignment? Is memory alignment differs, If a data type is local to a function or if it is a member of structure or union? How 32 to 64 bit processor afftects the memory alignment? - Sun, Dec 26 2004 10:37 pm 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.c/browse_thread/thread/819b49c577553db9 ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.c" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.c To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.c/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
