Getting the address of a statically allocated array into a pointer inside a struct <p>The simplified version of my code is the following:</p> <pre><code>struct args { int p; int *A; }; typedef struct sort_args sort_args; void func(int A[], int p) { args new_struct = {&amp;A, p}; args *args_ptr = &amp;new_struct; } </code></pre> <p>I'm trying to convert a statically (I think that's the term) allocated array into a pointer, but the compiler keeps throwing these warnings:</p> <blockquote> <p>warning: initialization makes integer from pointer without a cast [enabled by default] args new_struct = {&amp;A, p, r};</p> <p>warning: (near initialization for ‘new_struct.p’) [enabled by default] warning: initialization makes pointer from integer without a cast [enabled by default] warning: (near initialization for ‘new_struct.A’) [enabled by default]</p> </blockquote> <p>What am I doing wrong?</p>