mardi 21 décembre 2021

creating a class vector that does not delete it's content

I am a beginner , so i wanted to ask , can we create a class object vector/array , that does not delete it's content when i close the program like , so like I want a customer record , but whenever if we try to restart the program we need to enter the customer details again and again ... how to prevent that from happening

#include <iostream>
#include <vector>

using namespace std;
class customer{

    public:
    int balance;

    string name;
    int password;
};
int main(){
    vector <customer> cus;
    

    ... 

    if(choice == 1){
        cout << cus[i].balance
    }
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire