Friday, February 19, 2010

comp.lang.c - 25 new messages in 8 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* Efficency and the standard library - 5 messages, 3 authors
http://groups.google.com/group/comp.lang.c/t/ad9fea19f2f7dd61?hl=en
* The C FAQ - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.c/t/b75c0ae09abf3345?hl=en
* PAPER PRESENTATIONS AND SEMIMAR TOPICS. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/ddba53c6b950c89d?hl=en
* OLE - link or embed? - 10 messages, 6 authors
http://groups.google.com/group/comp.lang.c/t/2ac616c404485234?hl=en
* "SEXY Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela" "
pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD
GIRLS" - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/a80434831b341f2d?hl=en
* derived-type object - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c/t/cfab7b19dac62701?hl=en
* Sorting a Dynamic Array of Pointers - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/a803e1d1d602d8ef?hl=en
* remove leading zero in float formatted output - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/6877eba3a3139f1e?hl=en

==============================================================================
TOPIC: Efficency and the standard library
http://groups.google.com/group/comp.lang.c/t/ad9fea19f2f7dd61?hl=en
==============================================================================

== 1 of 5 ==
Date: Thurs, Feb 18 2010 11:48 pm
From: Malcolm McLean


On Feb 19, 9:24 am, spinoza1111 <spinoza1...@yahoo.com> wrote:
>
>What's insulting are people like Richard Heathfield who can't read
>code and seizes upon trivia such as malloc.h in order to waste my
>time, while enabling bullying.
>
So I write code using malloc.h. As it turns out, my compiler uses
alloc.h. It takes all of a second to hit the backspace and delete the
"m".
But what happens when we shop the code. It refuses to compile. So
someone who knows C edits it. But that means its got to go into a
different version. Then it hops to machine that takes malloc.h. So its
now in version 3.
The someone finds a bug with the code. He thinks, "obviously, this is
version 3, whilst we were shipped version 1. So let's test the code
with version 1." So he digs out version 1, recompiles, same bug. OK,
the bug was in the original version. As a matter of routine he diffs
the code. Version 1 and version 3 are identical. So maybe what he
thought was version 3 wasn't the real version 3. So he's on the phone,
talking to a guy who left the company who made the original version 2,
trying to find out what went on.
Eventually it will be sorted. But that's the sort of thing that
happens when you have tiny glitches in code.


== 2 of 5 ==
Date: Fri, Feb 19 2010 1:49 am
From: Richard Heathfield


spinoza1111 wrote:
<snip>
>
> A better solution (which takes constant time for each element and
> which doesn't "break" if presented with unusually long elements) would
> have been to use pointers to void in each node to point to the
> elements.

And where, pray tell, are you going to *store* your elements?

FCOL.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 3 of 5 ==
Date: Fri, Feb 19 2010 1:54 am
From: Richard Heathfield


spinoza1111 wrote:
> On Feb 19, 12:48 am, Richard Heathfield <r...@see.sig.invalid> wrote:
>> spinoza1111wrote:
>>
>> <snip lots of same ol' same ol'>
>>
>>> I have clear
>>> evidence of their incompetence: neither was able to even make a start
>>> on the replace() challenge,
>> Declining to enter your "challenge" shows not incompetence but good
>> judgement.
>
> Why? But I agree. It doesn't show incompetence. Try cowardice.

As the Bandit put it, "That's real good psychology. Why don't you say
something bad about my mother?"

If you have technical arguments, post them. If you *are* posting them,
which is just within the bounds of possibility, try posting them without
the drivel and the flame. Then there's a chance they might be spotted.

<nonsense snipped>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 4 of 5 ==
Date: Fri, Feb 19 2010 2:04 am
From: Richard Heathfield


spinoza1111 wrote:
<snip>
> What's insulting are people like Richard Heathfield who can't read
> code and seizes upon trivia such as malloc.h in order to waste my
> time,

When you get even trivial things wrong, it's a potential warning sign
that the rest may be problematic. Having said that, everybody gets
trivial things wrong from time to time. But when you take a long time to
get them right even after they've been pointed out to you, that suggests
even more strongly that the rest of the code is likely to have severe
problems. Reading buggy code wastes *my* time unless I can reasonably
predict that the OP will learn something from my comments. Experience
shows me that this is generally not the case with you. If you want me to
try to find non-trivial errors in your code, I will be glad to oblige if
I can, but only after you've fixed the trivial errors. So if you don't
want me to point out the trivial errors, don't make any.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 5 of 5 ==
Date: Fri, Feb 19 2010 5:28 am
From: Nick Keighley


On 19 Feb, 07:08, spinoza1111 <spinoza1...@yahoo.com> wrote:
> On Feb 19, 12:48 am, Richard Heathfield <r...@see.sig.invalid> wrote:
> > spinoza1111wrote:

<snip>

> > > Heathfield wrote a "linked list tool"
> > > without pointing to data,

<snip>

> [...] my point was that the DATA in the list is the DATA and
> not a link, and nobody with a halfway decent education in data
> structures would have proposed such a stupid design, save, perhaps,
> for a linked list of data elements whose type is simple and fixed in
> length...not a "reusable tool".

Alex Stepanov, the designer of the C++ STL library is untutored in
computer science? The STL is "value based" and copies the data. You
can make the data a pointer if you want to, but you don't have to.

<snip>

==============================================================================
TOPIC: The C FAQ
http://groups.google.com/group/comp.lang.c/t/b75c0ae09abf3345?hl=en
==============================================================================

== 1 of 4 ==
Date: Fri, Feb 19 2010 12:23 am
From: jacob navia


Nick a écrit :
> jacob navia <jacob@spamsink.net> writes:
>
>> Seebs a écrit :
>>> On 2010-02-12, jacob navia <jacob@nospam.org> wrote:
>>>> Linux is even more fragmented that the different Unix flavors at that time.
>>> I wrote a hunk of code which has one meaningful #ifdef in it, which is
>>> working on every Linux system we know of currently available.
>> First bet:
>>
>> It doesn't use any GUI
>>
>> Second bet:
>>
>> It doesn't use any sound/video/multimedia
>>
>> Third bet:
>>
>> It doesn't use any graphics, or mouse
>>
>> Obviously, THEN... it is portable. But it would be portable to
>> Mac/windows/whatever too without much pain.
>
> So what. Apart from a few specialist niche programs like operating
> systems and web browsers nobody needs to use old-fashioned things like
> that any more. That's all last millennium stuff.
>
> How much GUI, sound or mouse interaction do you think the programmers of
> recent hits like Facebook or Twitter have had to do, eh?
>

Ahhhh of course.

To use facebook you call a command line program, and you pass it the
list of your friends using the argc/argv mechanism of course...

You obtain a file of contacts, email, etc, and you read it using vi
or emacs.

Sure.


== 2 of 4 ==
Date: Fri, Feb 19 2010 12:33 am
From: Nick <3-nospam@temporary-address.org.uk>


jacob navia <jacob@nospam.org> writes:

> Nick a écrit :
>> jacob navia <jacob@spamsink.net> writes:
>>
>>> Seebs a écrit :
>>>> On 2010-02-12, jacob navia <jacob@nospam.org> wrote:
>>>>> Linux is even more fragmented that the different Unix flavors at that time.
>>>> I wrote a hunk of code which has one meaningful #ifdef in it, which is
>>>> working on every Linux system we know of currently available.
>>> First bet:
>>>
>>> It doesn't use any GUI
>>>
>>> Second bet:
>>>
>>> It doesn't use any sound/video/multimedia
>>>
>>> Third bet:
>>>
>>> It doesn't use any graphics, or mouse
>>>
>>> Obviously, THEN... it is portable. But it would be portable to
>>> Mac/windows/whatever too without much pain.
>>
>> So what. Apart from a few specialist niche programs like operating
>> systems and web browsers nobody needs to use old-fashioned things like
>> that any more. That's all last millennium stuff.
>>
>> How much GUI, sound or mouse interaction do you think the programmers of
>> recent hits like Facebook or Twitter have had to do, eh?
>>
>
> Ahhhh of course.
>
> To use facebook you call a command line program, and you pass it the
> list of your friends using the argc/argv mechanism of course...
>
> You obtain a file of contacts, email, etc, and you read it using vi
> or emacs.
>
> Sure.

No, you send it a stream of text (let's say something like
GET facebook.com HTTP/1.1\n\n
And it responds with a stream of text.

Really. That's now it's done.

Have a look at the URLs below. That's all done in C. OK, there's a few
non-ansi bits, but they are to do with data changes when multiple
instances of the program are running simultaneously and similar.

It doesn't use GUI. It doesn't use sound/video/multimedia. It doesn't
use graphics of mouse.

Why on earth should I do all that sort of tedious old-fashioned stuff
when the browser and server can do it for me?

Nick, moving tongue further as it didn't seem to get noticed last time.
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk


== 3 of 4 ==
Date: Fri, Feb 19 2010 12:45 am
From: gwowen


On Feb 19, 8:23 am, jacob navia <ja...@nospam.org> wrote:

> To use facebook you call a command line program, and you pass it the
> list of your friends using the argc/argv mechanism of course...

From the point of view of then backend, yes that it pretty much
exactly what it does. Remember, in all likelihood the program
generating your facebook page runs on a machine that does not have a
mouse, keyboard, soundcard or monitor. It's hard to do GUI
programming on such a machine.

From the point of view of the user interface, all that sound and event
handling have been abstracted away to a cross platform mechanism known
as a "web browser".


== 4 of 4 ==
Date: Fri, Feb 19 2010 12:56 am
From: Phred Phungus


gwowen wrote:
> On Feb 19, 8:23 am, jacob navia <ja...@nospam.org> wrote:
>
>> To use facebook you call a command line program, and you pass it the
>> list of your friends using the argc/argv mechanism of course...
>
> From the point of view of then backend, yes that it pretty much
> exactly what it does. Remember, in all likelihood the program
> generating your facebook page runs on a machine that does not have a
> mouse, keyboard, soundcard or monitor. It's hard to do GUI
> programming on such a machine.
>
> From the point of view of the user interface, all that sound and event
> handling have been abstracted away to a cross platform mechanism known
> as a "web browser".


Jacob,

Are you able to manipulate using C?
--
fred

==============================================================================
TOPIC: PAPER PRESENTATIONS AND SEMIMAR TOPICS.
http://groups.google.com/group/comp.lang.c/t/ddba53c6b950c89d?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Feb 19 2010 12:49 am
From: hot girl


PAPER PRESENTATIONS AND SEMIMAR TOPICS.
CHECK OUR VAST PAPER PRESENTATIONS AND SEMIMAR TOPICS INCLUDING
PROJECTS FOR FREE AT
http://presentationsandseminars.blogspot.com

==============================================================================
TOPIC: OLE - link or embed?
http://groups.google.com/group/comp.lang.c/t/2ac616c404485234?hl=en
==============================================================================

== 1 of 10 ==
Date: Fri, Feb 19 2010 12:51 am
From: Michael Foukarakis


On Feb 19, 9:36 am, Malcolm McLean <malcolm.mcle...@btinternet.com>
wrote:
> An *array* is a N-dimensional *array* (including a vector or a matrix).

Heh, that made me giggle.


== 2 of 10 ==
Date: Fri, Feb 19 2010 1:24 am
From: Phred Phungus


Malcolm McLean wrote:
> On Feb 18, 8:11 pm, Richard <rgrd...@gmail.com> wrote:
>> Richard Heathfield <r...@see.sig.invalid> writes:
>>
>> Please to comp.lang.programming.
>>
>> None of what you mention in in the C standard....
>>
> The thread is about a mixture of language and data structure issues,
> so is topical.
>

This is C:

void *DLGetData(DLLIST *Item,
int *Tag,
size_t *Size)
{
void *p = NULL;

if(Item != NULL)
{
if(Tag != NULL)
{
*Tag = Item->Tag;
}
if(Size != NULL)
{
*Size = Item->Size;
}
p = Item->Object;
}

return p;
}

http://i47.tinypic.com/a4bjax.jpg

How do I force data into this data structure?
--
fred


== 3 of 10 ==
Date: Fri, Feb 19 2010 1:26 am
From: Michael Foukarakis


On Feb 18, 7:11 pm, Richard Heathfield <r...@see.sig.invalid> wrote:
> When designing dynamic data structures (lists, stacks, trees, etc), one
> of the many choices open to us is one that was brought up in another
> thread recently - whether to link to existing data (what we might call
> an "index" approach), or to create a copy of the data and store that
> within the structure (a "container" approach).

This is quite interesting. I ran into it a few days ago after I
decided to use GLib and its nice collection of data types in a
networked application. I found it was extremely convenient to keep
pointers (an index) to certain messages that would represent preset
requests/responses between application instances so I only had to
allocate them once (or keep them in a file or whatever) and never
worry about their lifetime or deallocation. All I'd need in case I
wanted to send one was find the appropriate pointer and pass it to
send(), for instance. A container would do me no good in that
particular situation.

> Anyway, I'll kick off with one obvious advantage of each.
>
> Let's say you have data like this:
>
> {
>    char *name;
>    char *addr;
>    char *phone;
>
> }
>
> and you want to be able to search by any of those three criteria. One
> good way would be to create three indices (pointer lists), one for each
> sort order. To have three copies of the data would obviously be silly.

One container/index with a comparator[*] function would be just as
usable, and not at all silly, too. But then the question becomes;
which ordering do you want to impose on the data, which I guess
essentially leads to having 3 indices. ;-)

[*] A void *func(void *data, void *user_data); which could be passed
as an argument to a myarray_foreach() function which would allow us to
define a search function for each of the three (or N) fields...or
something to that effect.


== 4 of 10 ==
Date: Fri, Feb 19 2010 1:58 am
From: Richard Heathfield


Malcolm McLean wrote:
> On Feb 19, 6:10 am, ImpalerCore <jadil...@gmail.com> wrote:
>> I'm not completely opposed to calling it vector, but at the moment I think
>> that array is a better name.
>>
> A vector is a 1d array

Right.

> A matrix is a 2d array

Right.

> An array is a N-dimensional array (including a vector or a matrix).

A first order tensor is a 1d array.
A second order tensor is a 2d array.
A third order tensor is a 3d array.

And so on. It doesn't take long before a pattern can be seen to emerge. :-)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 5 of 10 ==
Date: Fri, Feb 19 2010 3:05 am
From: "bartc"


"Phred Phungus" <Phred@example.invalid> wrote in message
news:7u73n5FfclU1@mid.individual.net...
> Malcolm McLean wrote:
>> On Feb 18, 8:11 pm, Richard <rgrd...@gmail.com> wrote:
>>> Richard Heathfield <r...@see.sig.invalid> writes:
>>>
>>> Please to comp.lang.programming.
>>>
>>> None of what you mention in in the C standard....
>>>
>> The thread is about a mixture of language and data structure issues,
>> so is topical.
>>
>
> This is C:
>
> void *DLGetData(DLLIST *Item,
> int *Tag,
> size_t *Size)
> {
> void *p = NULL;
> if(Item != NULL)
> {
> if(Tag != NULL)
> {
> *Tag = Item->Tag;
> }
> if(Size != NULL)
> {
> *Size = Item->Size;
> }
> p = Item->Object;
> }
> return p;
> }

> How do I force data into this data structure?

I guess, something like the following?

void DLSetData(DLLIST *Item,
int Tag,
size_t Size, void* Object)
{
if(Item != NULL)
{
Item->Tag = Tag;
Item->Size = Size;
Item->Object = Object;
}
}

DLSetData(p, STRING, 9, "testdata");

The node won't own the data in this case. It could probably make it's own
copy, provided it is flat data (ie. no embedded pointers to data that also
needs duplicating).

--
bartc

== 6 of 10 ==
Date: Fri, Feb 19 2010 4:27 am
From: jacob navia


Richard Heathfield a écrit :
> When designing dynamic data structures (lists, stacks, trees, etc), one
> of the many choices open to us is one that was brought up in another
> thread recently - whether to link to existing data (what we might call
> an "index" approach), or to create a copy of the data and store that
> within the structure (a "container" approach).
>

You can have both.

In the container library I am writing you can:
(1) Store a pointer to your data and then manage the data yourself, or
(2) Store the data itself.

> Clearly each has its merits.

If you choose (1) you are responsible for allocating/deallocating
data. If you chose (2) it is the container responsability to allocate
and free the data. Note that the container copies the data. If you
receive a pointer to the data you should not free it of course.


== 7 of 10 ==
Date: Fri, Feb 19 2010 4:29 am
From: jacob navia


Richard Heathfield a écrit :
>
> You can add a destructor in C, too. You just have to call it explicitly,
> that's all.
>

Would it be useful to store a pointer to a destructor function in the
container?

Till now I haven't see any situation where that would be necessary. The
user can always call the destructor if needed.


== 8 of 10 ==
Date: Fri, Feb 19 2010 5:02 am
From: Richard Heathfield


jacob navia wrote:
> Richard Heathfield a écrit :
>> When designing dynamic data structures (lists, stacks, trees, etc),
>> one of the many choices open to us is one that was brought up in
>> another thread recently - whether to link to existing data (what we
>> might call an "index" approach), or to create a copy of the data and
>> store that within the structure (a "container" approach).
>>
>
> You can have both.

Right, because you can use a container-style structure for holding
pointers just as easily as you can hold any other type of object.

This is a strong argument in favour of containment, since it gives the
flexibility to serve both needs. A container can contain an index, but
an index can only index a container.

> In the container library I am writing you can:
> (1) Store a pointer to your data and then manage the data yourself, or
> (2) Store the data itself.
>
>> Clearly each has its merits.
>
> If you choose (1) you are responsible for allocating/deallocating
> data. If you chose (2) it is the container responsability to allocate
> and free the data. Note that the container copies the data. If you
> receive a pointer to the data you should not free it of course.

Yes. I think all of the above is generally true of well-designed containers.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 9 of 10 ==
Date: Fri, Feb 19 2010 5:05 am
From: Richard Heathfield


jacob navia wrote:
> Richard Heathfield a écrit :
>>
>> You can add a destructor in C, too. You just have to call it
>> explicitly, that's all.
>>
>
> Would it be useful to store a pointer to a destructor function in the
> container?

Yes. Well, that's what I do - the pointer is supplied to the constructor.

> Till now I haven't see any situation where that would be necessary.

Well, you have to tell the container's destructor how to destroy
contained objects at /some/ point, whether at construction time or at
destruction time. I just think it's more elegant to store the pointer,
so that the container always has full knowledge of how to tear itself
down. But it's a style issue, I think - I don't know of any compelling
arguments against either scheme.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 10 of 10 ==
Date: Fri, Feb 19 2010 5:26 am
From: Malcolm McLean


On Feb 19, 3:05 pm, Richard Heathfield <r...@see.sig.invalid> wrote:
>
> Well, you have to tell the container's destructor how to destroy
> contained objects at /some/ point, whether at construction time or at
> destruction time. I just think it's more elegant to store the pointer,
> so that the container always has full knowledge of how to tear itself
> down. But it's a style issue, I think - I don't know of any compelling
> arguments against either scheme.
>
It's a design issue.

Consider this. We have a generic array container. Now I can write a
routine that takes an array container as an argument, and removes
every item with a prime number index. Why I'd want to do that is
anyone's guess. However for some reason the program requires this
generic function.

If the array has a destructor for its contents, then we can write the
function

int removeprimes(ARRAY *a)

if it doesn't, we must write

int removeprimes(ARRAY *a, void (*destructor)(void *obj))

so far, this is workable.
But now let's say that the array contains elements that are allocated
from a pool, using a fixed-size allocator. The destructor must be

FIXEDMEMORYPOOL *pool;

void destructor(void *obj)
{
fixedfree(pool, obj);
}

That means we can only have one pool at a time. That could well be
unacceptable.

So it's got to be

int removeprimes(ARRAY *a, void (*destructor)(void *obj, void *ptr),
void *ptr)

The caller not only has to know how to destroy the elements in array,
he also has to know which pool they were allocated from. The system
rapidly becomes unworkable, and prone to design mistakes.

If we have a strict policy of every fucntion pointer takes an object
plus an arbitrary pointer, we don't have this problem.

typedef struct
{
void (*destructor)(void *obj, void *ptr);
void *ptr;
void *data;
size_t size;
int N;
} ARRAY;

The ARRAY is messy, but
void removeprimes(ARRAY *a)

is neat and clean.
It's almost always better to have the mess low down,a nd the high-
level interfaces clean.

==============================================================================
TOPIC: "SEXY Pamela Anderson" "hollywood actress" "hollywood wallpapers" "
pamela" "pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.
blogspot.com/ "pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "
SEXY HOLLYWOOD GIRLS"
http://groups.google.com/group/comp.lang.c/t/a80434831b341f2d?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Feb 19 2010 12:52 am
From: Naeem


"SEXY Pamela Anderson" "hollywood actress" "hollywood wallpapers"
"pamela" "pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS"

==============================================================================
TOPIC: derived-type object
http://groups.google.com/group/comp.lang.c/t/cfab7b19dac62701?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Feb 19 2010 3:19 am
From: "bartc"

"Keith Thompson" <kst-u@mib.org> wrote in message
news:lnfx509y11.fsf@nuthaus.mib.org...
> Joe Wright <joewwright@comcast.net> writes:

>> Why would the math library be loaded. Surely only the functions

> I'm actually not at all sure whether linkers generally load the
> entire math library or just the necessary function(s). The behavior
> probably varies from one linker to another, and my vague impression
> is that older linkers would tend to load the entire library.
> It might also vary depending on whether you're doing static or
> dynamic linking.

Isn't that the very reason for the existence of linkers? That they pick and
choose the functions from each module that are strictly necessary?

Otherwise they would just be loaders (ie. a program, such as I once used,
which just loaded each module into memory, did a few fixups, and wrote out
an executable, all with no discernable overhead).

--
bartc

== 2 of 2 ==
Date: Fri, Feb 19 2010 4:22 am
From: Ben Bacarisse


"bartc" <bartc@freeuk.com> writes:

> "Keith Thompson" <kst-u@mib.org> wrote in message
> news:lnfx509y11.fsf@nuthaus.mib.org...
>> Joe Wright <joewwright@comcast.net> writes:
>
>>> Why would the math library be loaded. Surely only the functions
>
>> I'm actually not at all sure whether linkers generally load the
>> entire math library or just the necessary function(s). The behavior
>> probably varies from one linker to another, and my vague impression
>> is that older linkers would tend to load the entire library.
>> It might also vary depending on whether you're doing static or
>> dynamic linking.
>
> Isn't that the very reason for the existence of linkers? That they
> pick and choose the functions from each module that are strictly
> necessary?

It depends what you mean by "module". In C, a module is often taken
to be a translation unit, and many linkers were (and some are still)
not able to pick out a single function from a compiled translation
unit.

In the days when linkers were slow, there was an art to placing
groups of functions in translation units within a library so as to
balance the cost in time of linking many small modules against the
cost in wasted space of including functions that were not really
needed.

<snip>
--
Ben.

==============================================================================
TOPIC: Sorting a Dynamic Array of Pointers
http://groups.google.com/group/comp.lang.c/t/a803e1d1d602d8ef?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Feb 19 2010 3:21 am
From: pete


jehugaleahsa@gmail.com wrote:
> Hello:
>
> I am playing around with a data structure in C. It is a dynamically
> growing array of pointers. So, really, it is just a void** with a
> count and capacity.

Why aren't you using a (person**) instead of a (void**)?

> I want to provide a sorting algorithm that takes a comparison function
> with the signature qsort expects.
>
> However, qsort is sending a void** instead of a void*,

I suspect that it isn't.

> so all the
> comparison functions need to be written like this:
>
> int person_comparison(void const* value1, void const* value2)
> {
> person *const* t1 = (person *const*)value1;
> person *const* t2 = (person *const*)value2;
> person *const p1 = *t1;
> person *const p2 = *t2;
> /* compare the two people */
> }
>
> I want to avoid forcing clients of my class to do this double
> dereference. However, I have no clue how to transform what qsort sends
> to the comparison. I was thinking about creating a function that would
> dereference the void**'s and then call the comparison the user passed
> in with the dereferenced void*'s. In C++, I would accomplish using a
> functor, but I don't know how to do this in C. I'd like to avoid
> writing my own quick sort.
>
> Let me know if you need to see more code. Any help would be
> appreciated.

Show me a C definition of a person.

--
pete

==============================================================================
TOPIC: remove leading zero in float formatted output
http://groups.google.com/group/comp.lang.c/t/6877eba3a3139f1e?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Feb 19 2010 4:10 am
From: Paul N


On 19 Feb, 02:03, migurus <migu...@yahoo.com> wrote:
> Is it possible to print a float or double and omit the leading zero in
> the following fasion:
> .123
>
> Code:
> float f = 0.1;
> printf("%.1f\n", f);
> result:
> 0.1
>
> Is there a trick with format string to get
> .1
> printed instead?

I don't think you can do it just by changing the format string, as the
standard says "If a decimal-point character appears, at least one
digit appears before it.". Possibly it might help to print the string
to a buffer, using sprintf, and then inspect that before printing it.

Hope that helps.
Paul.

==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate