Quote:
Originally Posted by raitodn
agree c++ is better, c++ is Object-oriented programming. What make things a lots easier  . Imo Inheritance, Encapsulation, Abstraction, Polymorphism are very important if you want to have a good arranged programm, I dont know if those things are necessary for writing a game.
well in my opinion java is better at those things then c++.
|
Object Oriented Programming is a
style of programming, and C++ is not a style. However, you can use OOP with C++. The other things you've mentioned are important but not required for a program.
Example:
Code:
#include <iostream>
using namespace std;
int main()
{int mainNum = 0;
int userInput;
cout << "Please enter an positive integer to continue, anything else to quit.\n";
while (cin >> userInput && userInput > 0)
{
mainNum += userInput;
cout << mainNum;
}
return 0;
}