On 9.3.18 11:05, The Natural Philosopher wrote:
> On 08/03/18 15:27, Martin Gregorie wrote:
>> On Thu, 08 Mar 2018 13:34:57 +0000, The Natural Philosopher wrote:
>>
>>> On 08/03/18 13:13, Martin Gregorie wrote:
>>>> On Thu, 08 Mar 2018 12:37:38 +0000, Martin Gregorie wrote:
>>>>
>>>> CORRECTION for stupid typo:
>>>>
>>>> /* Prototype, put in a header file, myfunction.h */
>>>> int myfunction(int, char*);
>>>> /* empty function as the only contents of a source file, myfunction.c
>>>> */
>>>> int myfunction(int bufflth, char* buff)
>>>> {
>>>> return 0;
>>>> }
>>>>
>>>>
>>>>
>>> I would at least put in a bit more
>>>
>>> int myfunction(int bufflth, char* buff)
>>> {
>>> return (int)buff[bufflth-1];
>>> }
>>>
>>> So you know where on the stack buff and bufflth are...
>>
>> Why would you want to know that? All the assembler operations using the
>> arguments will be inside myfunction() and, unless the code is calculating
>> a result to be returned and used elsewhere, the returned value is
>> probably to report success or failure.
>>
>>
> I cant believe you actually wrote that.
>
> Let me ask you a question.
>
> Why would you pass parameters to a function, and then not use them?
There are many reasons, e.g. the function can be a fill-in
replacement to a function needing and using the parameters.
--
-TV
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|