x=0;
t=0;

 int t2=0,t3;
 while(t<=ref)
  {t3=t2;

   for(x=0;x<jbn;x++)
	{ if(t==cpy2[x].at)
	    {
	       if(q>=cpy2[x].bt)
		      {
		      t2+=cpy2[x].bt;
		      tt[x++]=t2;
		      cpy2[x].bt=0;
		      qq++;
		      }
	       else if(q<cpy2[x].bt)
		       {
		       t2+=q;
		       cpy2[x].bt-=q;
		       cpy2[x].at=t2;
		       qq++;
		       }
	     }
	    else
	    break;
	    }


   t++;
   if(t3==t2)
	{t2++;}
   };

assuming the values are
cpy2[0].at==1
cpy2[0].bt==2
cpy2[1].at==2
cpy2[1].bt==3
cpy2[2].at==4
cpy2[2].bt==4
q==2
qq is just an add on
jbn==3
and
ref==10

the results are tt[]={3,5,9}

but we want tt[]={3,8,10}

can you help?

p.s.
dont suggest to initialize tt[] by that.... we need process!!

Recommended Answers

All 3 Replies

>can you help?
Yes.
This is what you need.

>>>can you help?
No -- I have no clue what that program is supposed to do. Don't expect me to read your other threads -- a thread should stand on its own.

And posts should NEVER be marked urgent! It's not urgent to us -- we'll get to it when we get to it. And many people simply bypass threads titled like this so you've just cut down your chances for help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.