this post was submitted on 23 Oct 2021
6 points (100.0% liked)

C & C++

890 readers
9 users here now

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] tofuwabohu@lemmy.161.social 1 points 3 years ago (1 children)

You use functions to extract code that does a specific thing to encapsulate it. So when you want to do a specific thing at three different places in your program, you don't need to write the same code three times but you call the function. It avoids redundancy and this is easier to maintain (only one place to fix stuff).

[–] the_tech_beast@lemmy.ml 1 points 3 years ago

Yes, got itπŸ˜€___