S
Skybuck Flying
I do understand it now.
I still think it sucks bad.
Bye,
Skybuck.
I still think it sucks bad.
Bye,
Skybuck.
int void [...];
^ It doesn't have the effect you think it does lol.
Anybody can post none working code and then go claim something stupid
like above.
In all my life of discussing I rarely give none compiling examples
unless there is a reason for it.
And in this case "void" is the reason.
Any discussion about anything else is irrelevant.
I know very damn well how an int works.
Where did you get the idea that that was in dispute?
In the example above, the 'Baz' parameter is really a 'BAZ **'. But the
function is not going to modify whatever 'PBAZ'-typed argument the
caller passes, so there's no need to pass "a reference." If anything,
the function might inspect whatever 'BAZ' the 'PBAZ' points to.
I don't think he has. I get the strong impression his only reason to
post here (or indeed anywhere else) is to annoy people.
No they are not off topic fool.
Any language idea can be discussed relating to C
Because it can always be added to the language.
I estimate your IQ to be zero.
You just a troll pretending to be dumb.
Hahahahaha !
So even if it were true what you were saying then that would mean
C and C++ are no longer compatible !
I shall round up/put a closure on this topic with one last final nice
posting (perhaps for noobies having to choose a language or experts
trying to understand the differences between the languages):
(Unless more reactions/replies come into it but I would prefer if
there weren't any because I like to close this topic now.)
The difference is actually:
1. Pascal has call by value and call by reference.
2. C only has call by value.
Because of limitation 2, C programmers use the pointer trick to pass the
address of a variable so it can be changed inside the routine, ...
For noobies/novice programmers this makes C a bad language since
noobies/novice programmers are still learning to design software codes and
will often need to change call by value to call by reference or vice versa
and then it becomes a hurdle to change all these call sites, not mention
confusion.
For experienced programmers it's also a reall burden to use * everywhere
and & everywhere, everywhere reference comes into play.
Why make things more difficult then absolutely necessary huh ?! =D
Only thing I can imagine is very very very maybe it's easier to write a
"call by value compiler" than a "call by reference compiler" ?!? But does
sound a bit like bullshit to me ?!
No they are not off topic fool.
Any language idea can be discussed relating to C
Because it can always be added to the language.
I estimate your IQ to be zero.
You just a troll pretending to be dumb.
Call by reference in pascal has huge adventages compared to C.
You accidently delete one little asterix somewhere and you have a crisis
Skybuck Flying said:Please stop the nonsense.
Call by reference in pascal has huge adventages compared to C.
You accidently delete one little asterix somewhere and you have a crisis
"Bad" is in the eye of the beholder. It's how C works. Indeed, truly
understanding pointers is often the hardest thing about learning C.
However, they're a core feature of the language, and the sooner you
start learning, the sooner you'll "get" how C works.
An experienced programmer should rarely have problems with them, since
part of gaining said experience is learning to use pointers. That's
where the real power of C comes from.
The basic philosophy of C is to expose the low-level operation of the
machine as much as possible and let the programmer, if desired, build
higher-level operations. If you only want to deal with higher-level
operations, then another language is probably more appropriate.
One might consider what would be required to add "references" to a C
compiler. To borrow the syntax from C++, one would have this:
void test(int&a) {
a = 5;
}
...
int b = 0;
test(b); // b==5 after call returns
However, to implement this, the reality is that the compiler would end
up producing identical output to what it would produce if it were given
this:
void test(int *a) {
*a = 5;
}
...
int b = 0;
test(&b); // b==5 after call returns
So, the only advantage of allowing the former is that it is arguably
easier for novices to understand, but it doesn't actually add anything
to the language--and it breaks the decades-old rule that functions
cannot change their parameters, which means programmers must closely
examine the declaration of every function they call to determine whether
or not it uses references.
C++ had a good reason to add this syntactical sugar: to avoid
(potentially expensive) calls to copy constructors for pass-by-value
arguments.
That reason does not apply to C; all that would be left is
pure syntactical sugar, and that goes against the philosophy above.
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.