+ 1
how to use structure in functions
struct dam { string name; string city; float capacity; float filled_space; int employee_num; struct dammanager manager; //pointer manager }; int main() { int num = 2 ; struct dam dams; cout << "please enter how many dam you want to add ?" << endl; cin >> num; //dams = new dam[num]; get_information(dams.manager.name, dams.manager.last_name, dams.manager.phone, dams.manager.age, dams.dam_name, dams.city, dams.capacity, dams.filled_space, dams.employee_num, num); //delete[] dams; return 0; } whats my problem i dont understand how should i put ? i want to use both dynamic array and structure in function
1 Respuesta
+ 1
Hello, struct is mostly used in C. But i think that it's the same with classes in C++. If you are in C++, it would be easier to use OOP with the classes because classes are easier to manage