Hi,
im trying to use the specific value of an array in a computation in another function; but don't know how to set it up. In test(), i want to use the 6th value of C[] in the computation. How do i set this up please?
im trying to use the specific value of an array in a computation in another function; but don't know how to set it up. In test(), i want to use the 6th value of C[] in the computation. How do i set this up please?
Code:
#include "stdafx.h"
#include <cmath>
const int size = 10;
double A[size] = {0},B[size] = {0}, C[size],c,d;
double PI = 3.141592653589793238462643383279502884197;
void rah(double C[])
{
for (int i=0;i<size;i++)
{
A[i] = sqrt(10*i);
B[i] = 2*PI*i;
C[i] = A[i]*B[i];
}
}
double test()//how do i write this correctly?
{
rah(C);
d = PI * rah(C[5]);
}
int main(int argc, char* argv[])
{
test();
// printf("Hello World!\n");
return 0;
}