in your game function, initilize b and w to something, 0 I guess should be fine.
Type: Posts; User: defcon
in your game function, initilize b and w to something, 0 I guess should be fine.
try:
if (hoursWorked>40){
overtime = (hoursWorked-40)*1.5;
hoursWorked = 40; // need to set this here,
salary = ((hourlyWage * hoursWorked) + (overtime * hourlyWage));
}
did you try this?
#define MTrAllocatedObject(Type) MTrAllocatedObjectType<Type >
jmd15's code prints it in reverse order.
#include <iostream>
using namespace std;
int main() {
int number;
cout << "Enter number" << endl;
cin >> number;
You need to assign the function call to something, else, the returned result is not useable.
a = blabla(a)
What interested you to learn programming? I'd suggest you start to do some simple things related to that.
Or solving some math problems are usually a good way to practice looping and logic.
Hi, glad to of helped. I am new to these forums too, as you can see from my post date :)
using namespace std; allows you to use cout and cin.
If you did not have this line then you would have to put std::cout and std::cin in your code in place of cout and cin. In some cases this is a...
You have to compare threatentry to each character individually, in your while loop.
To shorten the while loop and make the code more readable, I would suggest you do it like this:
#include...
Personally, if you need more then a few of the std commands I just use the entire namespace. I feel that it makes the code more readable and the speed difference is not HUGE, is it?
You will need two for loops to do it. Just draw the filler char everytime except when your loop counter varibles == 0 or the max row/col number.
There may be a better way to do this, but this...
Make a map editor for your game :) Or load data from text files.. that is how I've always done it but I don't make many games.
if you are using the standard namespace thne you don't need to put std:: in front of vector.
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> myVect; //...
If something is 'read only', you can't change it, logically. :p
It looks like Dae gave a good code sample that should solve your problem, or atleast point you in the right direction.
Good luck...
Yup ...
Start a new project with just the following code, see if that compiles. It should compile without any problems.
template <typename Type> class Vector {
public:
Vector(Type,Type,Type);
Type...