Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Declaring arrays: name of the array with spaces

$
0
0
Hey guys, I'm trying to understand a part of my professor's code. He gave an example for a hw assignment but I'm not sure how to understand this part of the code..

Here is the code:
void addTask(TaskOrAssignment tasks[], int& taskCount, char *course, char *description, char *dueDate)
{
	tasks[taskCount].course = course;
	tasks[taskCount].description = description;
	tasks[taskCount].dueDate = dueDate;          
	taskCount++;
}


1st question: Is "TaskOrAssignment tasks[]" considered the array name? Meaning is the "TaskOrAssingment" portion being renamed into "tasks[]?" I'm only asking because of the space between "TaskOrAssignment" and "tasks."

2nd question: Is "tasks[taskCount].course = course;" accessing or declaring a location for char course?

I hope I could get this answered and I'm pretty new to this site too.

Thank you.

*** Edit ***
Please use code tags when posting code.
:code:

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>