SHOW:
|
|
- or go back to the newest paste.
| 1 | void suma_complejos(struct complejo *datos, int num_datos, struct complejo *resultado) {
| |
| 2 | double x=0, y=0; | |
| 3 | int i; | |
| 4 | ||
| 5 | for(i=0;i<num_datos;i++){
| |
| 6 | - | x=x+*datos.real; |
| 6 | + | x=x+*datos->real; |
| 7 | - | y=y+*datos.imaginario; |
| 7 | + | y=y+*datos->imaginario; |
| 8 | datos++; | |
| 9 | } | |
| 10 | - | *resultado.real=x; |
| 10 | + | *resultado->real=x; |
| 11 | - | *resultado.imaginario=y; |
| 11 | + | *resultado->imaginario=y; |
| 12 | } |