1 Replies - 1215 Views - Last Post: 13 September 2009 - 12:17 PM Rate Topic: -----

#1 atslagle  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 12-September 09

How do I fix Error C2440?

Posted 13 September 2009 - 12:15 PM

How do I fix the error?
void LoadCourseRosters(ifstream& inStream, string courseRosters[][STUDENTS_PER_COURSE], int freeIndex[])
{
	int number;
	string str;
	getline (inStream, str, ',');
	CourseOffset(str);
	number = CourseOffset;
	getline (inStream, str);
	AddStudent(str, courseRosters, courseOffset, freeIndex);
	
}
void AddStudent(const string studentName, string courseRosters[][STUDENTS_PER_COURSE], const int courseOffset,							
				int freeIndex[])
{
	
}
int CourseOffset(const string courseName)
{
	int num;
	if (courseName == "CS108")
	{
		num = 0;
	}
	else if (courseName == "CS111")
	{
		num = 1;
	}
	else if (courseName == "CS140")
	{
		num = 2;
	}
	else if (courseName == "CS150")
	{
		num = 3;
	}
	else if (courseName == "CS240")
	{
		num = 4;
	}
	else if (courseName == "CS275")
	{
		num = 5;
	}
	else if (courseName == "CS312")
	{
		num = 6;
	}
	else if (courseName == "CS340")
	{
		num = 7;
	}
	else
	{
	}
	return(num);
}


Is This A Good Question/Topic? 0
  • +

Replies To: How do I fix Error C2440?

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,140
  • Joined: 14-September 07

Re: How do I fix Error C2440?

Posted 13 September 2009 - 12:17 PM

Is it here?

CourseOffset(str);
	number = CourseOffset;




Assign number to the return of that function, like this:

 number = CourseOffset(str);




If that's not it, please give the full error message.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1