R
R
ReD2015-10-23 18:49:23
Programming
ReD, 2015-10-23 18:49:23

Is it possible in C to define an array from a vector of values?

For example, define a vector first:

int f[X] = {8,9,8,9,11,13,15,15,15,14,14,14,13,13,12,12,11,11,10,10};

And then include it in functional dependency calculations:
for (int x=0; x<M; ++x)
{
     for (int y=0; y<N; ++y)
     {  
       T[x][f[x]]  = 100;
     }
}

That is, at each point along x, set the dependence of the form f (x).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Martyanov, 2015-10-23
@trinitr0

"For example, define a vector first:" - you define an array. Yes, you can write A[B[C[f[x]]]]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question