You have a few errors in your code. I have answered them with in line comments so you can read through it sequentially:
class App1 {
private:
int end = 3; // this hsould either be declared in the explicit public section you made, or an explicit private section.
public: // do you even indent bro
/* You can't declare an array like this in a class because
* the size end is not known at compile time and the compiler
* needs to know how many bytes to allocate for it. If this
* was a constant number, you could do it.
*/
// int list[3]; // this is fine
int* list_ptr = new int[end]; // this is better; it uses the heap so the compiler is ok not knowing the value of end at compile time. However, you have to remember to free it when you're done.
void AddInput(){ // You had App1:AddInput here. The namespace declaration is only needed if you are implementing this method outside the enclosing {} braces of the class definition. In this case, because you are implementing it within `class App1{ implementation }`, you are not to add the namespace before the function
for(int i=0; i<end; i++){
cout << endl << "Enter elements in array: " << endl;
int n; // need to declare n before you can read into it.
cin >> n;
list_ptr[i] = n;
}
}
void display(){
cout << endl << "Display elements: " <<endl;
for(int i=0; i< end; i++){ // this won't work the way you want; use the variable end
cout << "Elem " << i << " is: " << list_ptr[i] << endl; // youa accidentally wrote << end instead of << endl;
}
cout << endl;
}
}; // need to end class declaration with a semicolon