answersLogoWhite

0


Best Answer

A static function in class scope (within a class) can access only static class members (for all instances of the class).  A static function in file scope (not within a class) is visible only to code within that compilation unit, i.e. it cannot be linked from file to file.

User Avatar

Jose Luettgen

Lvl 13
2y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Functions are used for a few main reasons.

First, if you made a mistake you only need to fix it in one part of your code. If you had copied and pasted your function into dozens of parts of your project, there's a good chance you'll forget about some of them while trying to fix your bug.

Second, it will (or should) make your code easier to read. Functions with descriptive names are far more useful for describing what code does than comments.

Third, if you have a particularly large function which is called often, you will have much more concise code than if that code was not in a function. This helps with both readability and memory footprint.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Functions are key features of any programming language. This is because they allow programmers to break a problem into smaller chunks that solve the big problem. Apart from this they allow parts of the programming code to be reusable.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

It increases readability and functionality of a program.

As an afterthought. The main advantages of using functions in C programming is that you have to have at least 1 function if you want to write a program.

int main(int a, char **c)

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Benefits of using functions are:

1. Modularity

2. Reusability

3. Reduces program memory requirement

4. Same function can be accessed by multiple tasks (in a memory mapped environment)

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

You cannot write a C program without functions.

Function increase the understanding of program.

Function is reusable code ,if you want to call the function by single definition.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

function is a self contained sub-block statement.it is used to save the memory space.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

The 3 main advantages of functions are:

1.Re-usability.

2.We can call it from anywhere of the program.

3.User-defined functions can also created.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

to make the program easy to understand ..also there can be many blocks in the function.so it becomes more easy to read and understand it.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the benefits of using functions?
Write your answer...
Submit
Still have questions?
magnify glass
imp