dynamic mem alloc q

J

Joe Smith

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l;
size_t s;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

/* add code here */

}
} else {
while(s--)
putchar(' ');
putchar('^');
printf(" invalid character\n");
}
}

return 0;
}

/* int *dynarray;
dynarray = malloc(l * sizeof(long)); */
/* end source */

I seek to dynamically allocate memory of an array of unsigned longs with
array size determined from an unsigned long from the keyboard. With program
control as it exists now, it would seem that I would get the business done
where I have marked
/* add code here */
Do I need to redesign program control in order not to have a leak the size
of Texas? Joe
 
M

Michael Mair

Joe said:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l;
size_t s;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

Note: The values of l indicating potential errors are 0
and ULONG_MAX; as you want to allocate storage neither for 0
nor for ULONG_MAX array elements (at least if by "billion" you
mean 1e9), you can just test for >0 and <= 333333333UL (assuming
you mean "a third of a" by "third") in the first place.
Only if you have a failure there, I'd check using strspn() or
repeat the strtoul() call preceded by errno = 0.
This is more straightforward and entirely sufficient.
/* add code here */

}
} else {
while(s--)
putchar(' ');
putchar('^');
printf(" invalid character\n");
}
}

return 0;
}

/* int *dynarray;
dynarray = malloc(l * sizeof(long)); */
/* end source */

I seek to dynamically allocate memory of an array of unsigned longs with
array size determined from an unsigned long from the keyboard. With program
control as it exists now, it would seem that I would get the business done
where I have marked
/* add code here */
Do I need to redesign program control in order not to have a leak the size
of Texas?

Well, don't forget to free() allocated storage :)
Apart from that, only forgetting to check against l != 0 can be a
problem.

Cheers
Michael
 
J

Joe Smith

"Michael Mair" penned:
Joe said:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l;
size_t s;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

Note: The values of l indicating potential errors are 0
and ULONG_MAX; as you want to allocate storage neither for 0
nor for ULONG_MAX array elements (at least if by "billion" you
mean 1e9), you can just test for >0 and <= 333333333UL (assuming
you mean "a third of a" by "third") in the first place.
Only if you have a failure there, I'd check using strspn() or
repeat the strtoul() call preceded by errno = 0.
This is more straightforward and entirely sufficient.

'm' and 'b' are both labials in english. 'onnen' and 'arden' in german
don't penetrate the stupor of thought that a lot of persons who have who use
these words, i.e. regarding largish numbers. I would have thought that a
zero input would have succumbed to the ERANGE flag. It seeems to me,
however, that you're hinting my sniped code needs a tune-up here.
Well, don't forget to free() allocated storage :)
Apart from that, only forgetting to check against l != 0 can be a
problem.

I'll give it hell tonight. Joe
 
R

Robert Gamble

Joe said:
"Michael Mair" penned:
Joe said:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l;
size_t s;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

Note: The values of l indicating potential errors are 0
and ULONG_MAX; as you want to allocate storage neither for 0
nor for ULONG_MAX array elements (at least if by "billion" you
mean 1e9), you can just test for >0 and <= 333333333UL (assuming
you mean "a third of a" by "third") in the first place.
Only if you have a failure there, I'd check using strspn() or
repeat the strtoul() call preceded by errno = 0.
This is more straightforward and entirely sufficient.

'm' and 'b' are both labials in english. 'onnen' and 'arden' in german
don't penetrate the stupor of thought that a lot of persons who have who use
these words, i.e. regarding largish numbers. I would have thought that a
zero input would have succumbed to the ERANGE flag. It seeems to me,
however, that you're hinting my sniped code needs a tune-up here.

Below is the appropriate caveat I listed with the code when I
originally posted it:

"If the input contains only of whitespace or the minus sign the
converted value will be 0. "

The minus sign part does not, of course, apply to your version. The
word "contains" was supposed to be "consists".

I have tried to impress upon you the fact that the code was written to
meet a very specific need, what exactly are the needs *you* are trying
to accomidate?

Robert Gamble
 
M

Michael Mair

Joe said:
"Michael Mair" penned:
Joe said:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l;
size_t s;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

Note: The values of l indicating potential errors are 0
and ULONG_MAX; as you want to allocate storage neither for 0
nor for ULONG_MAX array elements (at least if by "billion" you
mean 1e9), you can just test for >0 and <= 333333333UL (assuming
you mean "a third of a" by "third") in the first place.
Only if you have a failure there, I'd check using strspn() or
repeat the strtoul() call preceded by errno = 0.
This is more straightforward and entirely sufficient.

'm' and 'b' are both labials in english. 'onnen' and 'arden' in german ITYM 'onen' and 'arden'.
don't penetrate the stupor of thought that a lot of persons who have who use
these words, i.e. regarding largish numbers.

I am not sure what you are trying to achieve with these
"witticisms" of yours: There are two possible meanings of "billion"
in English, so the question was just to clarify whether you mean
1e9 or 1e12.
Especially in a newsgroup frequented by native speakers and
non-native speakers alike, everyone should take care to express his
or her intent clearly and concisely.

I would have thought that a
zero input would have succumbed to the ERANGE flag. It seeems to me,
however, that you're hinting my sniped code needs a tune-up here.

Why don't you just read the documentation of strtoul()?
It will tell you that 0 and ULONG_MAX are the only return values
that _can_ indicate errors. As you need neither, no further
preliminaries are necessary.

I'll give it hell tonight. Joe

Good luck :)


Cheers
Michael
 
J

Joe Smith

"Michael Mair"
I am not sure what you are trying to achieve with these
"witticisms" of yours: There are two possible meanings of "billion"
in English, so the question was just to clarify whether you mean
1e9 or 1e12.
Especially in a newsgroup frequented by native speakers and
non-native speakers alike, everyone should take care to express his
or her intent clearly and concisely.

I would object to my witticism needing to be regarded as a string literal
had the grammar been correct. Maybe we should say something, as I have
serially witnessed German-English discussions fly off the rails right here,
usually by the English speaker thinking 'Milliard' was a million. I will
use billion to mean 10^9 and trillion to mean 10^12 .
Why don't you just read the documentation of strtoul()?
It will tell you that 0 and ULONG_MAX are the only return values
that _can_ indicate errors. As you need neither, no further
preliminaries are necessary.

I'll get to it over cereal today.

[snip]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l, i;
size_t s;
int *dynarray;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

/* dyn mem alloc */
dynarray = malloc((l+1) * sizeof(long));
if (dynarray != NULL)
{
/* populate array with the dummy's index */
for(i = 0;i <= l; ++ i) dynarray = i;
/* output: print em all */
for(i = 0;i <= l; ++ i) printf("%lu %lu\n", i, l);
free(dynarray);
}
/* else code for unsuccessful malloc here */

}
} else {
while(s--)
putchar(' ');
putchar('^');
printf(" invalid character\n");
}
}

return 0;
}
/* end source */
This compiles and seems to behave. At this point I wouldn't know what to do
with an unsuccessful malloc. This malloc was particularly effective when
gorgeous, blond Stephanie asked me whether what I was writing on the napkin
was difficult mathematics. I told her it wasn't easy. I tested for values
up to four million. It would seem quite possible that a computer might have
trouble storing one third of a billion longs. Joe
 
M

Michael Mair

Joe said:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l, i;
size_t s;
int *dynarray;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

/* dyn mem alloc */
dynarray = malloc((l+1) * sizeof(long));

Are you kidding?
In your OP, you wrote
,- <[email protected]> -
I seek to dynamically allocate memory of an array of unsigned
longs with array size determined from an unsigned long from the
keyboard.
`----
Now, you are allocating memory and assign it to an int *
variable. The "sizeof(long)" does not help either and seems like
something having been forgotten when switching from long to int.
Note that around here, the following way of using malloc() is
recommended as least error prone way:
unsigned long *dynarray;
....
dynarray = malloc((l+1) * sizeof *dynarray);
if (dynarray != NULL)
{
/* populate array with the dummy's index */
for(i = 0;i <= l; ++ i) dynarray = i;


This assignment could overflow.
If you use your compiler at the highest warning level, it
probably will warn you about that.
/* output: print em all */
for(i = 0;i <= l; ++ i) printf("%lu %lu\n", i, l);
free(dynarray);
}
/* else code for unsuccessful malloc here */

}
} else {
while(s--)
putchar(' ');
putchar('^');
printf(" invalid character\n");
}
}

return 0;
}
/* end source */

As mentioned in a previous post, I'd rather check for strtoul()s
possible error returns. This is probably more efficient and less
obscure than your method. It has the added benefit that you can
check whether the user input is in the required range and not in
the type range.


Cheers
Michael
 
J

Joe Smith

"Michael Mair"
Joe Smith schrieb:
Are you kidding?
Unfortunately, no.
In your OP, you wrote
,- <[email protected]> -
I seek to dynamically allocate memory of an array of unsigned
longs with array size determined from an unsigned long from the
keyboard.
`----
Now, you are allocating memory and assign it to an int *
variable. The "sizeof(long)" does not help either and seems like
something having been forgotten when switching from long to int.
Note that around here, the following way of using malloc() is
recommended as least error prone way:
unsigned long *dynarray;
....
dynarray = malloc((l+1) * sizeof *dynarray);
if (dynarray != NULL)
{
/* populate array with the dummy's index */
for(i = 0;i <= l; ++ i) dynarray = i;


This assignment could overflow.
If you use your compiler at the highest warning level, it
probably will warn you about that.


The argument for mallocing an array would seem to consist of something that
indicates the the number of boxes you're going to have multplied by how much
memory each of those boxes is going to take. (An array is a bunch of boxes
in a line with numbers on the side. One thinks of it this way and takes his
pills. Mine are blue.) The (l+1) part indicates the number of boxes, and C
being what it is, I ordered an extra box for zero.
As mentioned in a previous post, I'd rather check for strtoul()s
possible error returns. This is probably more efficient and less
obscure than your method. It has the added benefit that you can
check whether the user input is in the required range and not in
the type range.

But just as soon as a figure out longs, I'm going to want longers.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l, i;
size_t s;
unsigned long *dynarray;
printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

/* dyn mem alloc */
dynarray = malloc((l+1) * sizeof(long));
if (dynarray != NULL)
{
/* populate array with the dummy's index */
for(i = 0;i <= l; ++ i) dynarray = i;
/* output: print em all */
for(i = 0;i <= l; ++ i) printf("%lu %lu\n", i, l);
free(dynarray);
}
/* else code for unsuccessful malloc here */

}
} else {
while(s--)
putchar(' ');
putchar('^');
printf(" invalid character\n");
}
}

return 0;
}
/* end source */
I believe that this addresses what Mr. Mair was getting at, but that a
pointer would need to be an unsigned long makes no sense to me. There
doesn't seem to be much you could do in that /*else code */ part other than
to
printf("give me a smaller number or get more RAM\n");
Joe
 
J

Joe Smith

"Robert Gamble"
Joe Smith wrote:

[code snipped]
Below is the appropriate caveat I listed with the code when I
originally posted it:

"If the input contains only of whitespace or the minus sign the
converted value will be 0. "

The minus sign part does not, of course, apply to your version. The
word "contains" was supposed to be "consists".

I have tried to impress upon you the fact that the code was written to
meet a very specific need, what exactly are the needs *you* are trying
to accomidate?

I've always cheated with io and C. Indeed, I think the sheer punishment
that is the io syntax in C led many on a path that would leave them hanging
out with the polymorphism wizard. My first endeavor is to improve my
syntax. When I've got enough of that remembered, renewed, modified, revised
and added, I would like to play with combinatorial-sized numbers. Joe
 
C

CBFalconer

Joe said:
.... snip ...

I would object to my witticism needing to be regarded as a string
literal had the grammar been correct. Maybe we should say
something, as I have serially witnessed German-English discussions
fly off the rails right here, usually by the English speaker
thinking 'Milliard' was a million. I will use billion to mean 10^9
and trillion to mean 10^12 .

The simple cure is to simply write "1e9" or "1e12" as needed, and
retire the confusing verbiage. Similarly, the use of ISO standard
date formats can avoid much confusion.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
M

Michael Mair

Joe said:
"Michael Mair"
Joe Smith schrieb:

Are you kidding?

Unfortunately, no.
In your OP, you wrote
,- <[email protected]> -
I seek to dynamically allocate memory of an array of unsigned
longs with array size determined from an unsigned long from the
keyboard.
`----
Now, you are allocating memory and assign it to an int *
variable. The "sizeof(long)" does not help either and seems like
something having been forgotten when switching from long to int.
Note that around here, the following way of using malloc() is
recommended as least error prone way:
unsigned long *dynarray;
....
dynarray = malloc((l+1) * sizeof *dynarray);

if (dynarray != NULL)
{
/* populate array with the dummy's index */
for(i = 0;i <= l; ++ i) dynarray = i;


This assignment could overflow.
If you use your compiler at the highest warning level, it
probably will warn you about that.


The argument for mallocing an array would seem to consist of something that
indicates the the number of boxes you're going to have multplied by how much
memory each of those boxes is going to take. (An array is a bunch of boxes
in a line with numbers on the side. One thinks of it this way and takes his
pills. Mine are blue.) The (l+1) part indicates the number of boxes, and C
being what it is, I ordered an extra box for zero.


If dynarray is a pointer to int, dynarray will access a
signed int value. Assigning i, an unsigned long value, to
dynarray may lead to signed integer overflow.

unsigned long l, i;
unsigned long *dynarray;
dynarray = malloc((l+1) * sizeof(long));
for(i = 0;i <= l; ++ i) dynarray = i;

/* end source */
I believe that this addresses what Mr. Mair was getting at, but that a
pointer would need to be an unsigned long makes no sense to me.

No. Not the pointer is an unsigned long -- what it points to is of
type unsigned long. As you stated that you want an array l of unsigned
long (now rather an array l+1 of unsigned long), it is an error
to use a pointer to int: It is the wrong pointer type, dynarray
consequently will be of type int instead of type unsigned long.
There
doesn't seem to be much you could do in that /*else code */ part other than
to
printf("give me a smaller number or get more RAM\n");

The way the program is structured, that is about it.


Cheers
Michael
 
R

Richard Bos

Joe Smith said:
I would object to my witticism needing to be regarded as a string literal
had the grammar been correct. Maybe we should say something, as I have
serially witnessed German-English discussions fly off the rails right here,
usually by the English speaker thinking 'Milliard' was a million. I will
use billion to mean 10^9 and trillion to mean 10^12 .

Ah, but _that_, OTOH, has the disadvantage that you're only compatible
with USAnians and USAnianised[1] Britons[2]. The rest of the world knows
that a billion is 10e12. What's more, this incompatibility is harder to
detect than using milliard.

Richard

[1] Or should that be *USAnianized?
[2] More and more each day, and President^WPM Blair isn't helping.
 
R

Richard Heathfield

Richard Bos said:
Joe Smith said:
I would object to my witticism needing to be regarded as a string literal
had the grammar been correct. Maybe we should say something, as I have
serially witnessed German-English discussions fly off the rails right
here,
usually by the English speaker thinking 'Milliard' was a million. I will
use billion to mean 10^9 and trillion to mean 10^12 .

Ah, but _that_, OTOH, has the disadvantage that you're only compatible
with USAnians and USAnianised[1] Britons[2].

And, apparently, the French.

"Milliard" is, of course, the proper way to describe 1,000,000,000.
The rest of the world knows that a billion is 10e12.

We also know the proper end at which to open our eggs.
What's more, this incompatibility is harder to
detect than using milliard.

I will continue to use "billion" for 1e12 and "milliard" for 1e9, and if
people wish to misunderstand me, that is their problem, not mine.

[...] President^WPM Blair isn't helping.

Don't blame me. I didn't vote for him. (Ever.)
 
J

Joe Smith

"Richard Heathfield"
Richard Bos said:
"Joe Smith"
I would object to my witticism needing to be regarded as a string
literal
had the grammar been correct. Maybe we should say something, as I have
serially witnessed German-English discussions fly off the rails right
here,
usually by the English speaker thinking 'Milliard' was a million. I
will
use billion to mean 10^9 and trillion to mean 10^12 .

Ah, but _that_, OTOH, has the disadvantage that you're only compatible
with USAnians and USAnianised[1] Britons[2].

And, apparently, the French.

"Milliard" is, of course, the proper way to describe 1,000,000,000.
The rest of the world knows that a billion is 10e12.

We also know the proper end at which to open our eggs.
What's more, this incompatibility is harder to
detect than using milliard.

I will continue to use "billion" for 1e12 and "milliard" for 1e9, and if
people wish to misunderstand me, that is their problem, not mine.

[...] President^WPM Blair isn't helping.

Don't blame me. I didn't vote for him. (Ever.)


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>


#define BUF_MAX 80

int main (void) {
char buf[BUF_MAX];
unsigned long l, i, *dynarray;
size_t s;

printf("give me a number less than a third billion: \n");
while(fgets(buf, BUF_MAX, stdin) != NULL) {
if ((s = strspn(buf, "0123456789 \t\n")) == strlen(buf)) {
errno = 0;
l = strtoul(buf, NULL, 10);
if (errno == ERANGE) {
printf("number out of range!\n");
} else {

/* dyn mem alloc */
dynarray = malloc((l+1) * sizeof *dynarray);

if (dynarray != NULL)
{
/* populate array with the dummy's index */
for(i = 0;i <= l; ++ i) dynarray = i;
/* output: print em all */
for(i = 0;i <= l; ++ i)
{
/* printf("%lu %lu\n", i, l); */
}
free(dynarray);
}
/* else code for unsuccessful malloc here */
else
{
printf("malloc failed\n");
free(dynarray);
}

}
} else {
while(s--)
putchar(' ');
putchar('^');
printf(" invalid character\n");
}
}

return 0;
}
/* end source */
This is probably most directed at Mr. Mair, yet I wanted to comment on a
couple things said along the way and thought the better way to do that might
be to do it in one morningly post. Between an ell at 50 million and 60
million, the malloc fails on my 'puter. On the else branch, I still free
it, yet my unnamed OS doesn't seem to be the same after the malloc fails. I
have warnings set as high as I know how to put them and get none.

As to the language stuff, it's always been said that England and the US were
two countries separated by a language. After listening to Southern Neocon
Repugs for a seeming eternity, the split is much deeper than that.
Cbfalconer is exactly correct. If there is the chance of miscommunication,
show the exponent. I'm unaware of what a Standard date would look like, but
I always am wary of order in date and month when corresponding with
Continentals. Precise communication in clc, unlike the constant stream of
Kremlinized crap that flows out of our largest bully pulpit is, as they say,
impordint. Joe
 
K

Keith Thompson

Joe Smith said:
As to the language stuff, it's always been said that England and the US were
two countries separated by a language. After listening to Southern Neocon
Repugs for a seeming eternity, the split is much deeper than that.
Cbfalconer is exactly correct. If there is the chance of miscommunication,
show the exponent. I'm unaware of what a Standard date would look like, but
I always am wary of order in date and month when corresponding with
Continentals. Precise communication in clc, unlike the constant stream of
Kremlinized crap that flows out of our largest bully pulpit is, as they say,
impordint. Joe

I suggest that national politics, or even international politics, is
not a good subject for comp.lang.c. I have my own very strong
opinions in those areas, but I don't express them, or even allude to
them, here in comp.lang.c. The very last thing we need here is a
flame war about, say, US party politics.

But the real reason I'm posting this followup is to answer your
question about standard date formats. There is an ISO standard for
time and date formats, ISO 8601. The date format is YYYY-MM-DD, where
YYYY is the year, MM is the month (01..12), and DD is the day of the
month (01..31). It's unambiguous, it sorts correctly, and it's not
subject to variations in natural-language month names. For example,
today is 2006-05-11.

For more details, see <http://www.cl.cam.ac.uk/~mgk25/iso-time.html>.
 
N

Nelu

Richard said:
Richard Bos said:
Joe Smith said:
I would object to my witticism needing to be regarded as a string literal
had the grammar been correct. Maybe we should say something, as I have
serially witnessed German-English discussions fly off the rails right
here,
usually by the English speaker thinking 'Milliard' was a million. I will
use billion to mean 10^9 and trillion to mean 10^12 .

Ah, but _that_, OTOH, has the disadvantage that you're only compatible
with USAnians and USAnianised[1] Britons[2].

And, apparently, the French.

"Milliard" is, of course, the proper way to describe 1,000,000,000.
The english got the 'proper' use of billion from the French after the
17th century, apparently. The french mathematicians changed the group
of six digits to represent multiples of millions to groups of three
digits, a little later. US adopted the French system, but the French
switched back, again, to the old system, later. The English switched to
the US system afterwards. Supposedly the american use of billion was
more practical (at least in that period). There was also some story
related to the City of Ilion (Troy) but I forgot it :).

I've been away from the group for some time. It's good to be back! :)
 
J

Joe Smith

"Keith Thompson"
Joe Smith said:
[arguably inflammatory rhetoric intermixed with something topical]
I suggest that national politics, or even international politics, is
not a good subject for comp.lang.c. I have my own very strong
opinions in those areas, but I don't express them, or even allude to
them, here in comp.lang.c. The very last thing we need here is a
flame war about, say, US party politics.

But the real reason I'm posting this followup is to answer your
question about standard date formats. There is an ISO standard for
time and date formats, ISO 8601. The date format is YYYY-MM-DD, where
YYYY is the year, MM is the month (01..12), and DD is the day of the
month (01..31). It's unambiguous, it sorts correctly, and it's not
subject to variations in natural-language month names. For example,
today is 2006-05-11.

Politics qua politics is OT. I wanted to state on 2006-05-12 that this
isn't a good day for US programmers from a perspective of resource
allocation. Think, Keith, of all the stuff you have to do to get your
projects staffed and done. The US taxpayer now owns the largest piece of
digital duke ever instantiated. Data mining? Is that for hobbits? The army
of persons who have been sniffing packets needed to get
UP_CLOSE_AND_PERSONAL, for which they appear to lack either courage, or more
likely, conviction, and certainly, court approval. Did we really need to
invest these type of resources in other snafu? I'll try to focus again on
memory management techniques in the C programming language. Joe
 
K

Keith Thompson

Joe Smith said:
"Keith Thompson"
Joe Smith said:
[arguably inflammatory rhetoric intermixed with something topical]
I suggest that national politics, or even international politics, is
not a good subject for comp.lang.c. I have my own very strong
opinions in those areas, but I don't express them, or even allude to
them, here in comp.lang.c. The very last thing we need here is a
flame war about, say, US party politics.
[snip]

Politics qua politics is OT. I wanted to state on 2006-05-12 that this
isn't a good day for US programmers from a perspective of resource
allocation. Think, Keith, of all the stuff you have to do to get your
projects staffed and done. The US taxpayer now owns the largest piece of
digital duke ever instantiated. Data mining? Is that for hobbits? The army
of persons who have been sniffing packets needed to get
UP_CLOSE_AND_PERSONAL, for which they appear to lack either courage, or more
likely, conviction, and certainly, court approval. Did we really need to
invest these type of resources in other snafu? I'll try to focus again on
memory management techniques in the C programming language. Joe

None of this is relevant to the C programming language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top