ptrdiff_t maximum10648 (8/22/2010 7:43:59 PM) comp.lang.c # include # include int main (void) { ptrdiff_t const dx = ((ptrdiff_t) ~ ((ptrdiff_t) - 1 < 1 ? (-1 - (((ptrdiff_t) 1 << (sizeof (ptrdiff_t) * 8 - 2)) - 1 + ((ptrdiff_t... John
Symbol for "not" within []17279 (8/8/2010 9:08:13 PM) comp.unix.shell
I've been using something like this:
[[ a/bc == [^/]*/*[^/] ]] && echo match
(the "a/bc" is an example value)
to test whether a variable contains a file name having a relative path,
and it worke... John
Interix071 (8/6/2010 7:32:46 PM) comp.lang.perl.misc Anyone know if recent Perl tarballs build on Interix 3.5? -- Web mail, POP3, and SMTP http://www.beewyz.com/freeaccounts.php ... John
ANN: The daemon helper 2010-06-04037 (8/2/2010 1:13:31 AM) comp.unix.programmer The daemon helper 2010-06-04 Now it calls initgroups() when root uses the "set user" -u option. This was not necessary with an old kernel I was using, but on newer kernels, setuid() does not automatically in... John
piped open and shell metacharacters2529 (7/30/2010 2:39:47 PM) comp.lang.perl.misc The Camel book, 16.3.1. Anonymous Pipes says: > Perl uses your default system shell (/bin/sh on Unix) whenever a pipe > command contains special characters that the shell cares about. If > you're only startin... John
mysqld_safe0264 (7/28/2010 1:32:56 PM) comp.unix.shell
I compiled a mysql tarball and installed it into /usr/local instead of
using my vendor's package. While doing that, I noticed the mysqld_safe
shell script does not have any limit on failure restarts.
If... John
Two copies of one input stream128 (7/3/2010 5:57:54 AM) comp.unix.shell Two copies of one input stream -- I think I did this before but I forgot how. So I did it again. There's probably a better way, but this works: The "cat >Stream " commands are just a sample; you can replace... John
reader writer semaphores20648 (6/20/2010 8:17:17 PM) comp.unix.programmer I found some introductory material on the reader writer problem and semaphores at: http://greenteapress.com/semaphores/ and I want to code a reader writer solution in C, using POSIX semaphores on Linux (for ... John
dp5152 (10/26/2009 11:43:33 PM) comp.lang.c (d)aemon (p)rimer Possible alternative name for daemon helper. I emptied my killfile to collect opinions. Any known conflicts? I don't see any in a list of common UNIX utilities. -- Webmail for Dialup U... John
weird environ758 (10/7/2009 4:22:31 PM) comp.unix.programmer On NetBSD 5.0.1 getpwuid fails unless I set a dummy environment variable, which apparently causes the environ memory to be reallocated. I guess this is just a NetBSD bug, but it leads to another question. Wha... John
make a program that count lines in a text3987 (8/17/2010 9:09:19 PM) comp.lang.c I have a program which writes in the date and time into a txt file
everytime I
turn on my computer.
Ex:
Tue 08-03-2010 4:27:21.81p
Wed 08-04-2010 4:19:29.12p
Thu 08-05-2010 6:17:31.65p
Fri 08-06-20... jaswinder
How could a char be signed?45152 (8/19/2010 9:08:09 AM) comp.lang.c I do not understand how a char could be a signed char.
All the ASCII char's are positive numbers. What are
signed char's for if they exist. What are the differences between
signed char's and unsigned char'... Ann
trim whitespace106194 (8/19/2010 7:40:54 PM) comp.lang.c
static void
trim (char **ts)
{
unsigned char *exam;
unsigned char *keep;
if (!*ts) {
errno = EINVAL;
printf ("trim: %s\n", strerror (errno));
return;
}
... John
Where next?18332 (8/20/2010 9:05:12 PM) comp.lang.c Hey,
I've just finished my book on c and i'm wondering what do I do now?
I know about data structures, algorithms etc. but where do I go now to
advance my learning and become a professional?
Thanking you in... Sarah
trim whitespace, bullet proof version58227 (8/21/2010 5:38:51 AM) comp.lang.c
trim whitespace, bullet proof version
/*
Define author
John Kelly, August 20, 2010
Define copyright
Copyright John Kelly, 2010. All rights reserved.
Define licens... John
trim whitespace v3121169 (8/23/2010 7:50:28 AM) comp.lang.c
/*
Define author
John Kelly, August 20, 2010
Define copyright
Copyright John Kelly, 2010. All rights reserved.
Define license
Licensed under the Apache License,... John
Heap Overlays?7250 (8/23/2010 8:58:18 PM) comp.lang.c I am running Turbo C 3.0 in a DOS environment on an embedded board with
16MB DRAM installed. The heap at initialization is limited to about 490
kb, and is running out after less than an hour of malloc-ing me... jeff
Reusable source code74303 (9/6/2010 5:48:24 PM) comp.lang.c Jacob's mention of his library reminds me of my own
suggestion to help with software reusability.
Much software has the form
High Level -- application-specific code
Mid Level -- application-specific... jdallen2000(489)