Home > Back-end >  Call a function in C, execution inside a loop at a time
Call a function in C, execution inside a loop at a time

Time:10-04


Want to consulting the question is: how to modify the code, can let each time performs this function,
This for (int I=0; I & lt; PV. The size (); I++) circulating executed only once, but every time I want to add 1, the second performs this function
I will start from 2,
May say is not very clear, for example
For example: for the first time to carry out the function y1=pV. At (0)=10; Y2=pV. At (1)=20;
To perform this function for the second time when: y1=pV. At (2)=30; Y2=pV. At (3)=40;
Is every time after the function, but the above I in a for loop will as usual + 1;

CodePudding user response:

Feel I would have written the first for loop is wrong, but hope to have bosses, advice on how to modify the grateful

CodePudding user response:

the static int I=0;
i++;
For (; I & lt; PV. The size (); I++)

Defined above I can

CodePudding user response:

Wrong, correct the
Static int iStart=0;
IStart + +;

For (int I=iStart; .

This can let each function in iStart change once, I start from here

CodePudding user response:

Fun
reference 4 floor response:
wrong, correct the
Static int iStart=0;
IStart + +;

For (int I=iStart; .

This can let each function in iStart change once, I would be better to start from here

Thank you, have to solve problems of good
  • Related