dimanche 6 décembre 2020

how to read and store string? [closed]

I want to read and store string in separate variable.

for (int i=0; i < Vcount; i++){
    cout<<"vote:";
    string v=getline(cin,candidate[i].name);

        if(strcmp(candidate[i].name, v)==0){
            candidate[i].votes++;

        }

}

Aucun commentaire:

Enregistrer un commentaire