Article Index

Function to get a course number for the database.

#include "project.h"

void GetTitle(COURSE* record)
{
	int i;                                                   //Declare incrementing variable

	printf("Please enter the course title: ");                //print prompt
	fgets(record -> title, 65, stdin);                       //get response
	
	for(i = 0; i < 65; i++)                                 //place null at end of string
		if(record -> number[i] == '\n')
			record -> number[i] = '\0';

	return;
}
Log in to comment