Function type error when returning?

What value type does my function need to be to return the value I am trying to return?

Right now I get error:
"'return' cannot convert from 'int' to 'int'"

Also, what is the value type of "setMovies"? Is it a pointer or an array?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Unit 9 modularized.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;

// Declare functions.
int askStudents();
int askMovies(int getStudents);


//Declare variables.
int getStudents;

int main()
{
	getStudents = askStudents();
    return 0;
}

int askStudents()
{
	cout << "How many students were surveyed? ";
	cin >> getStudents;

	while (getStudents < 0)
	{
		cout << "Please enter a non-negative number: ";
		cin >> getStudents;
	}
	return getStudents;
}

int askMovies(int getStudents)
{
	// Creating array "setMovies" with size of getStudents using pointer.
	int *setMovies;
	setMovies = new int[getStudents];

	// Storing the amount of movies each student watched into setMovies array.
	for (int i = 0; i < getStudents; i++)
	{
		cout << "How many movies did each student watch: ";
		cin >> setMovies[i];
	}
	return setMovies;
}

The type pointer-to-int is not the type int.
The trailing asterisk (int*) is relevant.
Topic archived. No new replies allowed.