Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct
- {
- unsigned int NumofParam;
- double ExperimentResults[3];
- double ValueofParamOne[3];
- double ValueofParamTwo[3];
- }EXP_CONDITION;
- int main()
- {
- EXP_CONDITION stInputs;
- EXP_CONDITION* pstInputs;
- pstInputs = &stInputs;
- pstInputs->NumofParam = 2U;
- EXP_CONDITION ExpNum[3];
- /*assign values to Experiment 1*/
- ExpNum[0].ValueofParamOne[0]=200;
- ExpNum[0].ValueofParamTwo[0]=400;
- ExpNum[0].ExperimentResults[0]=1000;
- /*assign values to Experiment 2*/
- ExpNum[1].ValueofParamOne[1]=210;
- ExpNum[1].ValueofParamTwo[1]=440;
- ExpNum[1].ExperimentResults[1]=2000;
- /*assign values to Experiment 3*/
- ExpNum[2].ValueofParamOne[2]=220;
- ExpNum[2].ValueofParamTwo[2]=480;
- ExpNum[2].ExperimentResults[2]=3000;
- myfunction(&stInputs);
- return 0;
- }
- myfunction(ExpNum);
- void myfunction(EXP_CONDITION* expNum)
- {
- double foo = expNum[0].ValueofParamOne[0];
- double bar = expNum[1].ValueofParamOne[0];
- double baz = expNum[2].ValueofParamOne[0];
- // ...
- }
Add Comment
Please, Sign In to add comment