// Area rectangulo
#include <iostream>
using namespace std;
typedef struct {
int x;
int y;
} Vector;
typedef struct {
Vector esquina1;
Vector esquina2;
} Rectangulo;
void mostrar_area(Rectangulo* ptr, int cap);
int main() {
const int CAPACIDAD = 2;
Rectangulo rec[CAPACIDAD] = {{0,0,3,4},{0,0,5,5}};
mostrar_area(rec, CAPACIDAD);
}
void mostrar_area(Rectangulo* ptr, int cap) {
float area = 0;
for (int j = 0; j < cap; ++j) {
area = abs(ptr[j].esquina1.x - ptr[j].esquina2.x) * abs(ptr[j].esquina1.y - ptr[j].esquina2.y);
cout << "Area de rectangulo " << j << "\t:\t" << area << endl;
}
}