T
tom st denis
§1.9 page 29 has this function.
int getline (char s[], int lim)
Unless I'm missing something here to pass an array shoudn't that first
parameter be char *s ?
Bill
**** off.
§1.9 page 29 has this function.
int getline (char s[], int lim)
Unless I'm missing something here to pass an array shoudn't that first
parameter be char *s ?
Bill
Go **** yourself. That's what I have been told.
Bill Cunningham said:§1.9 page 29 has this function.
int getline (char s[], int lim)
Unless I'm missing something here to pass an array shoudn't that first
parameter be char *s ?
tom st denis said:... char s[] is equivalent to char *s ...
tom said:If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.
Of course I know that Dick. What's that got to do with anything? Read
the standard.
int getline (char s[], int lim)
Unless I'm missing something here to pass an array shoudn't that first
parameter be char *s ?
... char s[] is equivalent to char *s ...
As you know, the equivalence applies only for function parameters.
tom st denis said:That's what I have been told.
If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.
tom said:If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.
And you should know Prick that char s[] and char *s *are not* equivalent
always.
If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.
But in certain contexts, they are not the same. The question is reasonable.
tom said:And since clearly you seem to know this [judging by your reply here]
why the **** are you asking?
None of your God Damn Business and *I* was right. But that's not my point..
You Obviously didn't understand the original question in you infinite
mind. Dick.
You asked if a char s[] inside a parameter list should instead be char
*s.The answer is no. It doesn't have to be.
[snip]
I have never seen good function prototypes except these examples declare an
array definition as char s[] in the prototype. Are you looking at a babie's
code? They must be writing like this is kandr2 to simplify things.
tom st denis said:Â Â Â Â Â Â Â Â Â Â ... char s[] is equivalent to char *s ...
As you know, the equivalence applies only for function parameters.
Yup, but I was replying in context to his original question so the
pedantic police need not apply.
Bill Cunningham said:tom said:If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.
Of course I know that Dick. What's that got to do with anything? Read
the standard.
tom st denis said:[...]
... char s[] is equivalent tochar *s ...
As you know, the equivalence applies only for function parameters.Yup, but I was replying in context to his original question so the
pedantic police need not apply.
Nevertheless, I was concerned that other readers might not pay
sufficient attention to the context.
If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.
But in certain contexts, they are not the same. The question is reasonable.
As a function parameter? They're entirely interchangeable. It's
convention to use the star but you can use [] if it floats your boat.
Bill Cunningham said:tom said:If you don't know that char s[] is equivalent to char *s by now you
have to be trolling and are deserving of contempt.Of course I know that Dick. What's that got to do with anything? Read
the standard.
Will *both* of you please calm the &^%$ down?
tom said:**** off.
tom said:It's convention to use the star but that's not mandatory. Just like
you could writechar a[4];a[3] = 4;
3[a] = 4;They're equivalent C code. Most people would use the former instead
of the latter even though they have the same effect.
In my original question I was asking about convention.
Unless I'm missing something here to pass an array shoudn't that first
parameter be char *s ?
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.