If I were you, I would not start out learning to program a class with any user interaction. Get the basics down first, and then when you have a good grasp of classes, then you can start interacting with the user. Here is an example of a simple class:Originally Posted by sal880612m
Code:include <iostream> using namespace std; class Apple { public: int size; }; int main() { Apple myApple; myApple.size = 10; cout<<myApple.size<<endl; return 0; }



LinkBack URL
About LinkBacks


