online C programming test

  • Thread starter E. Robert Tisdale
  • Start date
J

Jarno A Wuolijoki

Calling me a liar, heh? Very smooth.

BTW, many == 3 in this case:
Tom wrote "not valid"
Jarno (agreed?)

Minus one: I pointed out that the local variable is inaccessible so
the reasoning doesn't apply.
 
R

Richard Heathfield

MSG said:
Calling me a liar, heh? Very smooth.

No, I wasn't. If I think you're lying, I'll say so. I didn't think you were
lying. I did consider the possibility that you were mistaken.
BTW, many == 3 in this case:

Less than half, then. When it's as few as 3, and also less than half the
field, I think I'd baulk at using "many".

Even better! Think of me as a juror, not his defense attourney - I
think he's fit to represent himself.

Whatever. Those of us who've been here for a while reached our conclusions
long ago. Like I said - you just don't know him well enough yet. But you
will, you will.

BTW, anyone who "knows C" would only find "off-topic" messages
interesting here.

I quite enjoy (and am therefore quite interested in) helping other people to
learn about C. I don't find off-topic messages particularly interesting. So
either your argument is wrong /or/ I don't know C (or, conceivably, both).
 
E

E. Robert Tisdale

Something said:
Yes, but others failed it many times as well, sometimes thanks to him,
e.g. when many C people stated that you could not return structs from
functions. I don't want to google, but it went something like this:

struct foo f(void) {
struct foo s;
s.x = x;
s.y = y;
s.z = z;
return s;
}

Actually, it was something like this:

struct x x_create(int a, int b) {
struct x result;
result.a = a;
result.b = b;
return result;
}

Your example is seriously flawed.
Either you are an incompetent C programmer
or your example was a "test" of subscribers' C programming skills.
My guess is that the former (and not the latter) is correct.
*Many* (but not ERT) said you could not do this in C.
So let's be fair here.

1. obvious troll handle: MSG
2. disposable email address: yahoo.com
3. contentious subject: test failure
designed to provoke an emotional response
4. doesn't participate or take a position
in the discussion (remains "aloof").

Please learn to recognize (and ignore) trolls.
 
T

Tristan

Jarno said:
On 5 Feb 2004, MSG wrote:

Minus one: I pointed out that the local variable is
inaccessible so the reasoning doesn't apply.

Whereupon Tom (St. Denis), realizing his think-o, withdrew
his original assertion.

Nick (Landsberg) was responding to something else entirely
in a later post, in which Mr. Tisdale claimed:

[snip code]

Mr. Landsberg stated (fairly explicitly) that using this
would lead to undefined behavior.

So in the end, it appears that many == 0.

What was your point again?
 
M

MSG

E. Robert Tisdale said:
Actually, it was something like this:

struct x x_create(int a, int b) {
struct x result;
result.a = a;
result.b = b;
return result;
}

Your example is seriously flawed.
Either you are an incompetent C programmer
or your example was a "test" of subscribers' C programming skills.
My guess is that the former (and not the latter) is correct.


1. obvious troll handle: MSG
2. disposable email address: yahoo.com
3. contentious subject: test failure
designed to provoke an emotional response
4. doesn't participate or take a position
in the discussion (remains "aloof").

Please learn to recognize (and ignore) trolls.


Dear Sir,

Thank you very much for the timely troll alert, and please accept my
most sincere apologies for all of my misdeads. There is absolutely no
excuse, and I accept full responsibility for my actions and their
consequences. I would like to assure you that I will do my best to
avoid hurting your or anyone's feelings in the future.

Sincerely,
MSG
 
R

Richard Heathfield

MSG said:
Dear Sir,

Thank you very much for the timely troll alert, and please accept my
most sincere apologies for all of my misdeads.

What misdeeds? All you did was try to stick up for ERT - and look how he
treats you in return! But fear not - you are in rather good company.
Several clueful regular contributors to this newsgroup have been called
trolls by ERT. It's his substitute for technical argument.
 
J

Joona I Palaste

What misdeeds? All you did was try to stick up for ERT - and look how he
treats you in return! But fear not - you are in rather good company.
Several clueful regular contributors to this newsgroup have been called
trolls by ERT. It's his substitute for technical argument.

Hey! No fair! Trollsdale hasn't called *me* a troll yet! Come on,
Trollsdale! Call me a troll! I'm using an obvious troll handle (my
real name), a disposable e-mail address (.helsinki.fi) and everything!
 
A

Anupam

If x,y and z are global variables accessible at that point in the
program, there is absolutely no reason why this is flawed.
 
H

Harald Korneliussen

Peter Pichler said:
Not wanting to defend Mr ERT, I must regretfully say that most GPL code I
have seen looks worse. Moreover it is usually highly non-portable. Is there
a clause in GPL that I missed that says that the source must be unreadable?

Peter

Ah, I'm relieved to hear it's not just me. I _though_ C didn't have to
look like that.

Do you have any good counterexamples? I'd like to take a look at some
real quality C code someday.
 
C

CBFalconer

Harald said:
Ah, I'm relieved to hear it's not just me. I _though_ C didn't
have to look like that.

Do you have any good counterexamples? I'd like to take a look
at some real quality C code someday.

do {
Pick any regular here who publishes a URL.
Look for code published under GPL etc.
Evaluate portability and clarity for yourself.
} while not satisfied.

Most of us take pride in those characteristics.
 
L

Larry Doolittle

Ah, I'm relieved to hear it's not just me. I _though_ C didn't have to
look like that.

Do you have any good counterexamples? I'd like to take a look at some
real quality C code someday.

IMHO, Busybox and the Linux kernel each contain a lot of high-quality
C code. Being real-world projects with contributions from many people,
they _also_ contain a lot of hack-quality code and system extensions
from standard C. I trust you will be able to tell which is which. ;-)

- Larry
 
M

MSG

Richard Heathfield said:
What misdeeds?

All of them.
All you did was try to stick up for ERT - and look how he
treats you in return! But fear not - you are in rather good company.

I just knew my constant trolling and total incompetence as a C
programmer would pay off one day!
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top