#include <iostream>using namespace std; class Student { public: // stuff int* GetNumDaysPerCourse() const; // stuff private: //stuff int numDaysPerCourse[3]; // stuff}; int* Student::GetNumDaysPerCourse() const { return numDaysPerCourse;} int main() { Student s; s.GetNumDaysPerCourse(); return 0;}
Standard input is empty
prog.cpp: In member function ‘int* Student::GetNumDaysPerCourse() const’: prog.cpp:17:12: error: invalid conversion from ‘const int*’ to ‘int*’ [-fpermissive] return numDaysPerCourse; ^~~~~~~~~~~~~~~~
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!