Question: How to increment a variable by 1 whenever a function is called? (C PROGRAMMING) I have a variable called currentSize in my main which tracks

How to increment a variable by 1 whenever a function is called? (C PROGRAMMING)

I have a variable called currentSize in my main which tracks the size of my array as i add elements to it. How do i write my code so that whenever i call my add function in main it increments the currentSize variable?

Please dont use pointers as i am a beginner in c and my course hasnt taught up to there yet, thank you.

in main which i want to increment by 1 whenever i call my add function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!