comp.lang.c
  Home FAQ Contact Sign in
comp.lang.c only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  trying to find the error         


Author: mdh
Date: May 1, 2008 20:13

K & R 5-5 asks for a strncat function ( concat n characters of t);

void mystrncat(char *s, char *t, int n)

{

while ( *s++); /* find end of s */ /* <<<<< 1 */

/* stops at '\0' */ /* <<<<<2 */

while ( *t && n-- > 0)

*s++ = *t++; /* /*<<<<< 3 */

while ( n -- > 0);
*s++ = '\0';

}

Now, with 1 I **Thought** that *s++ fails when *s == '\0', so that s
points to '\0'.
So, when 3 occurs, I thought the first char of t ( *t) is assigned to
the "Old" position of s, which should be '\0', but it is not.
What am I missing.
Thanks in advance.
8 Comments
  ED hardy shoes Supplier ( paypal accept ) ( www.super-saler.com ) ED hardy shoes Supplier ( paypal accept ) ( www.super-saler.com )         


Author: shoespaypal
Date: May 1, 2008 20:10

Y-3 Supplier ( paypal accept ) ( www.super-saler.com )
Y-3 shoes Supplier ( paypal accept ) ( www.super-saler.com )
CHANEL shoes Supplier ( paypal accept ) ( www.super-saler.com
)
Chanel Supplier ( paypal accept ) ( www.super-saler.com )
CHANEL shoes Supplier ( paypal accept ) ( www.super-saler.com
)
ED hardy shoes Supplier ( paypal accept ) ( www.super-saler.com
)
ED hardy shoes Supplier ( paypal accept ) ( www.super-saler.com
)
Y-3 Supplier ( paypal accept ) ( www.super-saler.com )
Y-3 shoes Supplier ( paypal accept ) ( www.super-saler.com )
CHANEL shoes Supplier ( paypal accept ) ( www.super-saler.com
)
Chanel Supplier ( paypal accept ) ( www.super-saler.com )
CHANEL shoes Supplier ( paypal accept ) ( www.super-saler.com
)
ED hardy shoes Supplier ( paypal accept ) ( www.super-saler.com
) ...
Show full article (4.60Kb)
no comments
  dsq shoes Supplier ( paypal accept ) ( www.super-saler.com )LV shoes Supplier ( paypal accept ) ( www.super-saler.com )         


Author: cheapsneakerfan
Date: May 1, 2008 20:07

LV shoes Supplier ( paypal accept ) ( www.super-saler.com
)
LV shoes Supplier ( paypal accept ) ( www.super-saler.com )
LV shoes Supplier ( paypal accept ) ( www.super-saler.com )
D&G shoes Supplier ( paypal accept ) ( www.super-saler.com
)
Dsquared Supplier ( paypal accept ) ( www.super-saler.com
)
Dsquared shoes Supplier ( paypal accept ) ( www.super-saler.com
)
dsq shoes Supplier ( paypal accept ) ( www.super-saler.com
)
dsq shoes Supplier ( paypal accept ) ( www.super-saler.com
)LV shoes Supplier ( paypal accept ) ( www.super-saler.com
)
LV shoes Supplier ( paypal accept ) ( www.super-saler.com )
LV shoes Supplier ( paypal accept ) ( www.super-saler.com )
D&G shoes Supplier ( paypal accept ) ( www.super-saler.com
)
Dsquared Supplier ( paypal accept ) ( www.super-saler.com ...
Show full article (5.76Kb)
no comments
  converse Supplier ( paypal accept ) ( www.super-saler.com )converse Supplier ( paypal accept ) ( www.super-saler.com )         


Author: cheapsneakerfan
Date: May 1, 2008 20:07

converse Supplier ( paypal accept ) ( www.super-saler.com
)
converse Supplier ( paypal accept ) ( www.super-saler.com )
converse Supplier ( paypal accept ) ( www.super-saler.com )
soccer Supplier ( paypal accept ) ( www.super-saler.com
)
soccer shoes Supplier ( paypal accept ) ( www.super-saler.com
)
converse Supplier ( paypal accept ) ( www.super-saler.com
)
converse Supplier ( paypal accept ) ( www.super-saler.com )
converse Supplier ( paypal accept ) ( www.super-saler.com )
soccer Supplier ( paypal accept ) ( www.super-saler.com
)
soccer shoes Supplier ( paypal accept ) ( www.super-saler.com
)
converse Supplier ( paypal accept ) ( www.super-saler.com
)
converse Supplier ( paypal accept ) ( www.super-saler.com )
converse Supplier ( paypal accept ) ( www.super-saler.com ) ...
Show full article (4.26Kb)
no comments
  C popularity         


Author: Bob Nelson
Date: May 1, 2008 18:45

Some postings in this newsgroup over the past few months have questioned the
popularity of the C programming language.

For what it's worth, the ``Reader's Choice Awards 2008'' from _Linux
Journal_ shows that C was voted the favorite programming language, slightly
ahead of both C++ and Java:

http://www.linuxjournal.com/article/10065

My experience on the Linux platform is that C is still widely used, not just
in the kernel and device drivers but also in userland, too.
26 Comments
  new free fiction         


Author: mickey333
Date: May 1, 2008 18:17

no comments
  Simple Single-Threaded Region Allocator...         


Author: Chris Thomasson
Date: May 1, 2008 17:34

Here is the code:

http://pastebin.com/m4a405e67

One advantage to using a region allocator is that you can usually skip most
calls to free. Instead you can merge multiple free calls into a single reset
call. Here is simple example:
___________________________________________________________________
int main(void) {
allocator this_allocator;
Show full article (1.61Kb)
11 Comments
  Reading input doesn't work         


Author: NaN
Date: May 1, 2008 15:25

Hi I'm using Dev-C++.

Here is my sourcecode.

/* GETCH.C: This program reads characters from
* the keyboard until it receives a 'Y' or 'y'.
*/

#include
#include

void main( void )
{
int ch;

_cputs( "Type 'Y' when finished typing keys: " );
do
{
ch = _getch();
ch = toupper( ch );
} while( ch != 'Y' );
Show full article (0.50Kb)
3 Comments
  Pointers, typedef's and const's         


Author: Alex
Date: May 1, 2008 14:00

The code below can't be compiled:

typedef char* POINTER;
const POINTER ptr;
ptr++;

The compiler (Sun C 5.8 Patch 121015-04 2007/01/10) complains:

"test.c", line ...: operand must be modifiable lvalue: op "++"

It looks like the "const POINTER" has been compiled to "char* const".
A question is - why?

Best wishes,
Alex
7 Comments
  A site for all your C/C++ programming language needs         


Author: gokul
Date: May 1, 2008 07:44

A site for all your C/C++ programming language needs. Find more
details on code implementation, flow chart preparation and many more

http://www.blogonprogramming.blogspot.com
http://www.sqlserversoftware.blogspot.com
1 Comment
1 2