economizing with functions that do the same thing

K

Keith Thompson

pete said:

I think you're right. A quick look through the archives doesn't show
any indication that Frederick Gotham is the same person as "Joe Smith"
or "Your Uncle". I just confused the names somehow.

I apologize.

Since I appear to have messed this up, and I'm no longer sure who is
who, I withdraw my recommendation for people's killfiles. Everyone
should, as always, use his or her own judgement.
 
P

pete

I think you're right. A quick look through the archives doesn't show
any indication that Frederick Gotham is the same person as "Joe Smith"
or "Your Uncle". I just confused the names somehow.

Well you know, Frank starts with an Fr and ends with a k,
just like Frederick.
Silvermann ends with an a followed by two n's,
kind of looks like an m.

;)
 
Y

Your Uncle

ITYM, Frank (Not Fred, he used to work for CBS) Silvermann


I have to ask, in all seriousness, what's the percentage/what's the
psychic benefit you get from slamming people you don't understand?
I go out to the pub. I come back. Can someone explain to me what killfile
means in the context of the C programming language. By someone, I do not
mean a parochial American. getchar() f
 
Y

Your Uncle

Where's Dan ?
solution for him.
Disclaimer: It is easily possible that I misremember -- I
just tracked down the thread but did not read it.



<snip>
Wir sollten auf Deutsch. Ich bliebe lieber auf "Sie." Bitte informiere
mich wie ich Sie beleidigt habe? Kenneth Ford
 
R

Richard Heathfield

Your Uncle said:
"Richard Heathfield"
It doesn't do me a lick of good to snipe source, germane to what I know,
which I do not understand.
Truly.

You had a generic swap posted

....which, if you do not understand it, you should ask questions about.
and I frankly
can't quite remember what else, but in response to the what else, I wrote:
/* pruefer.c */
# include "big four.h"

/* bigfour.h */
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <time.h>
/* end bigfour.h */
Does this look like C?

The program didn't. The header does (although I prefer not to mask standard
headers in that way, it is certainly legal to do it).
The question is meant to proceed along two lines:
q1) If I approach my compiler with this, will cl.exe give me
errors/warnings.
Yes.

q2) I conjecture that "bigfour.h" is not included in the c
standard.

You are correct.
Given that the possibly non-standard header includes ONLY
standard headers, what can a person say about it?

That either the comment is not describing the filename accurately, or the
#include directive in your C file is wrong.
 
R

Richard Heathfield

Frederick Gotham said:

I expect an apology from you once you have confirmed my innocence --

For the record, he has already done so (elsethread). He got you mixed up
with someone else.

anything less would portray you as a malicious, inhospitable person.

You make a great contribution to the group, Keith, and I regularly find
your posts interesting -- but your elevated status on this group does not
warrant the malicious behaviour you have displayed.

Keith hasn't displayed any malicious behaviour. He's just pointing out a
kook's multiple IDs for the benefit of anyone who hasn't spotted them yet,
and he accidentally caught your name up in the middle of it, for which, as
I say, he has already apologised.

If Keith has an "elevated status" on this group, it is because he is a
helpful, intelligent subscriber who is knowledgeable about the C language.
But he is not perfect. He makes mistakes, as we all do.

Twice to my knowledge, you have over-reacted to being corrected. This time,
you have over-reacted to a case of mistaken identity - with, it must be
said, rather more justification this time.

But in your own interests, you might want to consider dialing your
touchiness back to about 2 or 3. Right now, it's so high it's annoying the
neighbours.
 
A

av

/* pruefer.c */
# include "big four.h"
#define MILL (.001)
int fu(int, int);
int main(void)
{
unsigned long g, un_long_dummy, r = s = 0;
int m = 3, n = 17000, mean_less_one, t;
printf("taunt::continue: Y/N");
if (getchar == 'N') break;

getchar should be a function
so you here would compare the address of function getchar and (int)'N'

i advise you it is better to read and *follow* and resolve the
exercises on K&R2

this for me should be
int c;
label:;
printf("taunt::continue: Y/N > ");
while((c=getchar())==' ');
if(c=='N' || c=='n' || c=='\n') return 0;
else if(c!='Y') goto label;
if(c!='\n') // for flush the line of input
while((c=getchar())!='\n');

i don't understand the remain but pc can understand better than me
 
K

Keith Thompson

Frederick Gotham said:
Keith Thompson posted:


Hey hey hey what's all this about?!

I post under one name and one name only.

If you're THAT certain that I have an affiliation with the others you
have mentioned... then PROVE IT, rather than sabotaging the enjoyable
experience a sincere poster has on this newsgroup.

I expect an apology from you once you have confirmed my innocence --
anything less would portray you as a malicious, inhospitable person.

You make a great contribution to the group, Keith, and I regularly find
your posts interesting -- but your elevated status on this group does not
warrant the malicious behaviour you have displayed.

Frederick, please accept my apologies.

I had no malicious intent (and I'm not sure why you assumed that I
did). It was an honest mistake, and I'll be careful not to repeat it.
 
F

Frederick Gotham

Keith Thompson posted:
Frederick, please accept my apologies.

I had no malicious intent (and I'm not sure why you assumed that I
did). It was an honest mistake, and I'll be careful not to repeat it.



Thank you.


Back to C!
 
F

Frederick Gotham

Richard Heathfield posted:
Frederick Gotham said:



For the record, he has already done so (elsethread). He got you mixed
up with someone else.


I had posted before he posted his subsequent post.

Keith hasn't displayed any malicious behaviour. He's just pointing out
a kook's multiple IDs for the benefit of anyone who hasn't spotted
them yet, and he accidentally caught your name up in the middle of it,
for which, as I say, he has already apologised.


Yes, I now accept that it was nothing more than an accident. However, in
life in general, I can't presume that everything ill-deed toward me is an
accident, which is why I presumed malice was involved rather than
accidental actions.

I had no intention of engaging in the conversation until I was
recommended for a kill file.

If Keith has an "elevated status" on this group, it is because he is a
helpful, intelligent subscriber who is knowledgeable about the C
language. But he is not perfect. He makes mistakes, as we all do.


Of course exactly. Calculate the precentage of posts here which are by
him, then take their quality into account, and you're left with a very
great contribution.


However perhaps you can appreciate my "inappreciation" at being
recommended for a kill file, when I all I aim to do here is engage in
interesting and enjoyable conversation pertaining to the C programming
language.

Twice to my knowledge, you have over-reacted to being corrected. This
time, you have over-reacted to a case of mistaken identity - with, it
must be said, rather more justification this time.

But in your own interests, you might want to consider dialing your
touchiness back to about 2 or 3. Right now, it's so high it's annoying
the neighbours.


Back to the C programming language.
 
K

Keith Thompson

Frederick Gotham said:
Keith Thompson posted:


I only post to this newsgroup as "Frederick Gotham".

If you like my posts, then that's brilliant -- I enjoy posting here, and
it's a great hobby for me. If you don't like my posts, or if you suspect I
am posting under other aliases, I don't care to discuss the topic.

You probably posted this before you saw my apology in the original
thread.

I welcome the opportunity to reiterate that I was mistaken in
including Frederick Gotham's name in the list.
 
Y

Your Uncle

Richard Heathfield said:
Your Uncle said:


...which, if you do not understand it, you should ask questions about.


<rather bizarre program snipped>
No, bizarre is when grown men speak of kill and file, without a handle on
either.
The program didn't. The header does (although I prefer not to mask
standard
headers in that way, it is certainly legal to do it).


Yes.
They will be such that I can deal with them.
You are correct.


That either the comment is not describing the filename accurately, or the
#include directive in your C file is wrong.
Let me be more specific. A source text includes it's own header: fu.h whose
text is # include <stdio.h> . My question goes to c linkage. Indeed, when
linkage is the issue I think the terms c++ linkage or c linkage need a
terminology update. This question is to .c - c linkage. cheers, furunculus
 
N

Nick Keighley

[I *think* I got the attributions right]


I go out to the pub. I come back. Can someone explain to me what killfile
means

a killfile is a file used by some news reraders containing list of
people
whose posts you don't want to see. Hence to "killfile" someone is to
add
them to your killfile, because they are annoying or uninteresting or
whatever.

Posting under multiple aliases is irritating. Kenny is irritating.
[...]in the context of the C programming language.

it's to do with news groups rather than the C language
By someone, I do not mean a parochial American.

I find much of what you say quite incomprehensible. Are things like
this jokes?
getchar() f

??
 
K

Kenny McCormack

<rather bizarre program snipped>
No, bizarre is when grown men speak of kill and file, without a handle on
either.[/QUOTE]

What makes you think they are "grown".

From what I can tell, they are all just frustrated high school kids
(inside).
 
Y

Your Uncle

I appreciate your Einsatz and never forget a kindness. I've hit day's end
with my compiler:
/* Text1.c */
# include "Text2.h"
#define MILL (.001)
int fu(int, int);
int main(void)
{
unsigned long g = 15, un_long_dummy, r = 0, s = 0;
int m = 3, n = 17000, mean_less_one, t;
srand(time(NULL));
mean_less_one = (n - m) / 2;
printf("mu is %d\n" , mean_less_one);

for (un_long_dummy = 0; un_long_dummy < g; ++ un_long_dummy)
{
t = fu(m, n);
/* printf("tja"); */
if (t <= mean_less_one) ++ r;
else ++ s;
}
printf("r is %ul while s is %ul\n", r, s);
return 0;
}
int fu(int m, int n)
{
int t;
t = rand();
/* printf("tja"); */
return t;
}
/* end .c */
I don't see why r and s do not add to g here. I could talk about it but it
would only reveal the thickheadedness that motivates the question. I know
that there was some talk about unsigned longs and zero. I would certainly
hope that Mr. Ritchie had the foresight to include the additive identity of
the ring of integers in the datatype. So, I'm forced to believe that I'm
cross-eyed. gruss, furunculus
 
Y

Your Uncle

Ian Collins said:
For a trivial example, the overhead would outweigh the benifit of a
generic function.

For a more complex example, you are stuck with the function not knowing
the type passed in and the compiler not being able to check whether the
passed types are supported.
And that's what he meant with "callback functions?" I can't get my head
around it. cheers, f
 
I

Ian Collins

Your said:
And that's what he meant with "callback functions?" I can't get my head
around it. cheers, f
Dan might have been referring to functions you would have to pass along
with the type to do whatever the action is.

For example in you print_a_something case, you would have to pass in the
something and a function to return the the appropriate format string.
If the something was more complex than a POD, a function to do the
printing would be required.
 

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

Members online

Forum statistics

Threads
474,184
Messages
2,570,976
Members
47,536
Latest member
MistyLough

Latest Threads

Top