Data Structures example in tutorial.

I am reading through this(http://www.cplusplus.com/files/tutorial.pdf p. 78) tutorial and it has been very useful thus far. I recently got hung up on data structures example program that takes in the user's favorite movie and the year it was released.

There is a void function called printmovie(movies t movie) that references the data structure:

1
2
3
4
  struct movies_t { 
 string title; 
 int year; 
} mine, yours; 


But I don't understand why the argument for this void function is "movies t movie" and not just "movie t". Can somebody explain this?
notice the underscore. movies_t is the type. So that is why you need the type movies_t and a name for the object movie

Also I think those are the older tutorials the newest ones are here: http://www.cplusplus.com/doc/tutorial/ Though, most of it is probably the same
Last edited on
Topic archived. No new replies allowed.