All pastes #24758 Raw Edit

Mine

public cpp v1 · immutable
#24758 ·published 2005-10-06 19:34 UTC
rendered paste body
#include <cstdlib>#include <vector>#include <iostream>using namespace std;typedef struct _student {    char szName[256];    float fScore;} student;int main(int argc, char *argv[]) {    vector<student> vStudents;    student curr;     while (1) {        /* Read name */        cin >> curr.szName;        if (!strcmp(curr.szName, "quit")) break; /* quit */                /* Read score */        cin >> curr.fScore;        /* Add the item to the vector */        vStudents.push_back(curr);    }            /* Print the items of the vector */    int i;    for (i = 0; i < (int)vStudents.size(); i++)        cout << vStudents[i].szName << "\t" << vStudents[i].fScore << "\n";        return 0;}