0

I know this is a stupid questions

how do i send this :

struct Activity {
    int i,               // Beginning node number.
        j;               // Ending node number.
    float  pt,           // Pessimistic time. 
           prt,          // Most probable time.
           ot;           // Optimistic time.
    char desc[21];       // Activity description.
  } p[51];

into this:

using namespace std;

float* expect_t(float expt[], *p, int n)
 {
  for( int i = 1; i <= n; ++i ) {
    expt[i] = ( p[i].pt + ( 4.0f * p[i].prt ) + p[i].ot ) / 6.0f;

  }
  return expt;
 }

Any help would be appreciated.

Edited by Dani: Formatting fixed

2
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by sinrtb
0
using namespace std;

float* expect_t(float expt[], *p, int n, Activity & myActivityStruct)
 {
  for( int i = 1; i <= n; ++i ) {
    expt[i] = ( p[i].pt + ( 4.0f * p[i].prt ) + p[i].ot ) / 6.0f;

  }
  myActivityStruct.someAttribute = someValue;  
//deleted your attributes and forgot what they were, just sub someAttribute 
//with something from the struct
  return expt;
 }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.