What is the difference between a function and a subroutine?

前端 未结 11 1561
攒了一身酷
攒了一身酷 2021-01-30 06:32

What is the difference between a function and a subroutine? I was told that the difference between a function and a subroutine is as follows:

A function takes parameters

11条回答
  •  生来不讨喜
    2021-01-30 07:19

    A function returns a value whereas a subroutine does not. A function should not change the values of actual arguments whereas a subroutine could change them.

    Thats my definition of them ;-)

提交回复
热议问题