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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input into record/array

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to input an ID number into a program and have it go to that particular ID and then input a series of numbers into an array that is present there...how would i go about doing this?

ID is a record and i need to refer to another field in this record which has an array in it, i need to enter values

hope you guys can help :)

Code:
void enter_numbers(number *ptr)
{
	int num,i,j,k=0,total;
	
	for(i=1;i<counter;i++,ptr++)
	{
		total=0;
		printf(&quot;\n\tEnter ID number&quot;);
		scanf(&quot;%d%&quot;,m);
		
		for(j=0;j<8;j++)
			{  
				printf(&quot;\n\tEnter the results for this ID&quot;,j);
	   			scanf(&quot;%d&quot;,&k);
		        ptr->score[j] = k;		
		   		total=+k;
			}
				ptr->total_score =total;
	
		
	}
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top