basically if we take the input from user by asking him, like below:
cout << "Enter your course code and course name: ";
Now if user enters this "CS201 Introduction to Programming", now how can I only assign the code part i.e. 'CS201' to an array, lets say;
char courseCode[10];
And how can I assign the name part in the array, lets say:
char courseName[50];
I want to do this to 5 students, using the structure, defined below:
struct student
{
char courseName[50];
char courseCode[10];
};
student stu[5];
Kindly help me, I can't figure out how can I divide the input in two parts and assign them in two different arrays which are present in the structure I defined above. Thanks in advanced.