I\'m trying to write a function that returns a struct which i canuse later and t
ID: 3614986 • Letter: I
Question
I'm trying to write a function that returns a struct which i canuse later and this is how i did it and there seems to be somethingwrong could you helptypedef struct{ double x, y, z; }elctron
electron e_gaussian(int n_electron){ electron e_grid[n_electron]; ............... return e_grid; }
void draw_electrons(){ electron e_grid = e_gaussian(n_electrons); ......................; }
typedef struct{ double x, y, z; }elctron
electron e_gaussian(int n_electron){ electron e_grid[n_electron]; ............... return e_grid; }
void draw_electrons(){ electron e_grid = e_gaussian(n_electrons); ......................; }
Explanation / Answer
//here is basic structure of theprogram. #include #include #define n_electron 10 typedef struct { double x, y, z; }electron; electron e_gaussian(int n_elect) { electron e_grid[n_elect]; //............... return e_grid[0]; } void draw_electrons(){ electron e_grid = e_gaussian(n_electron); //......................; } int main() { printf(" "); system("pause"); }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.