Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

records

Status
Not open for further replies.
Dec 5, 2004
3
US
hi i hope you guys can help me as my life depends on it :(

I have an array of records and have to access one of these records and change a fields value. How would I go about writing the code for this?

eg i have a structure already defined and one of the fields is called score, how would i access this field in the record and assign a set of values, i need to add 9 values to this record as the person has 9 scores. Incrementing the pointer would move it down to the next element, but i need to input this data all in the same record.

Is it possible to assign more than one value in a field as i need to input 9 values for each person,all in one field!

i`m so confused:(

i`ve been using this syntax.. ptr->score

 
Given:

Code:
struct Record
{
    int score;
};

Record array[ 10 ];


array[ 5 ] would be a specific Record, so to modify the score of array[ 5 ], you'd just say array[ 5 ].score = 7;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top