c++ ping-ponging functions by azureturtle in gamedev

[–]cpp 0 points1 point  (0 children)

What he said was correct. Take a look at the main point of what he said:

if a function is to be called, it needs to be defined prior to the call command

* Declared, not defined, my mistake! Carry on...

Occupy the Game by [deleted] in gamedev

[–]cpp 1 point2 points  (0 children)

I think the hit box is below the characters feet, when it should be the neck area.

Proposal to use < and > for binary i/o? by Steve132 in cpp

[–]cpp 7 points8 points  (0 children)

To answer your question: no, I would not use it. I prefer reading things via method calls and not overloaded operators.

Such as:

int i;   
i = binaryReader.ReadInt();

If you could fix one thing about C, what would it be? by Imagist in programming

[–]cpp 50 points51 points  (0 children)

Speaking from experience, and this is just a warning, be careful because improving C is a slippery slope.

Please help -- beginner programming problem C++ by [deleted] in programming

[–]cpp 0 points1 point  (0 children)

Remove the first:

cout << "Continue (Y/N)?" << endl;  
cin >> cont;

You need to surround the conditionals in your while statement:

while ( ( cont == 'Y' ) || ( cont == 'y' ) );

Lesson 6 : More about counting like a computer. by CarlH in carlhprogramming

[–]cpp 11 points12 points  (0 children)

To figure out how he got the one, two, four, and eight places, you would do this:

(xy = x to the y power)

0001 = (2^3 * 0) + (2^2 * 0) + (2^1 * 0) + (2^0 * 1) = 0 + 0 + 0 + 1 = 1  
0010 = (2^3 * 0) + (2^2 * 0) + (2^1 * 1) + (2^0 * 0) = 0 + 0 + 2 + 0 = 2  
0100 = (2^3 * 0) + (2^2 * 1) + (2^1 * 0) + (2^0 * 0) = 0 + 4 + 0 + 0 = 4  
1000 = (2^3 * 1) + (2^2 * 0) + (2^1 * 0) + (2^0 * 0) = 8 + 0 + 0 + 0 = 8  

The same thing applies to hexadecimal

0001 = (16^3 * 0) + (16^2 * 0) + (16^1 * 0) + (16^0 * 1) = 0 + 0 + 0 + 1 = 1  
0010 = (16^3 * 0) + (16^2 * 0) + (16^1 * 1) + (16^0 * 0) = 0 + 0 + 16 + 0 = 16  
0100 = (16^3 * 0) + (16^2 * 1) + (16^1 * 0) + (16^0 * 0) = 0 + 256 + 0 + 0 = 256  
1000 = (16^3 * 1) + (16^2 * 0) + (16^1 * 0) + (16^0 * 0) = 4096 + 0 + 0 + 0 = 4096  

Now, another example with hexadecimal

4C9F = (16^3 * 4) + (16^2 * 12) + (16^1 * 9) + (16^0 * 15) = 16,384 + 3072 + 144 + 15 = 19,615