Yes, all the sides are either vertical or horizontal. And I just thought about using the vertices
to check which side collided in the shower last night as well. :)
Thanks for the idea of using bits that correspond to different sides and changing them to
represent which side collided with...
My problem is not so much with programming it, but rather determining which side is collided.
And for those who aren't familiar with SDL, SDL_Rect is just a structure that hold an x and y
position along with a width and height ( (x,y) is the top left corner of the rectangle).
So here is how...
Ah, thanks for the help. It was the double declaration problem. I never know that you only had to specify default parameters in function prototypes and not the actual definition.
I started using g++ and the command line on linux.
In one section of my code, I provide a default argument for a function parameter.
I'm just wondering why this sometimes brings up an error if i don't include -fpermissive
when I'm compiling everything.
As an example. This is the...
I decided to make the switch from C to C++ and I'm having trouble with vectors. In C, I prefer to use dynamically allocated arrays when doing multidimensional arrays. But in C++, I know that there is the new function which replaced malloc. I read that when dealing with multidimensional arrays in...
Using T for the kinetic energy is the convention used by my professor and i agree that it was odd when i first saw it as well. Second, i completely forgot about the tension, which only confuses me ever so more in how i need to incorporate it into the equation. I am thinking it depends on mB.
Homework Statement
When the 65-kg cylinder is released from rest, the spring is subjected to a tension of 75. Determine the speed of the cylinder after it has fallen 300. How far has it fallen when it momentarily stops?
Given Diagram:
Homework Equations
The Attempt at a...
Homework Statement
Determine the velocity of the 60- block A if the two blocks are released from rest and the 40- block B moves 0.6 up the in cline. The coefficient of kinetic friction between both blocks and the inclined planes is = 0.05.
Here is the given diagram:
The Attempt at a...
So, if I get what you are saying, would I change this:
charLoc [i] = (int *) malloc (NUM_COLS * sizeof (CharPointers));
to this:
charLoc [i] = (int *) malloc (NUM_COLS * sizeof (CharPointers *));
and if the above is correct, do you know what I would need to change to make this...
But how would i use that in this context? I know that i can do that for when I'm going from pointers to structs, but what would I do for the from an int array to a pointer part?
I wanted to make a variant on having a player just walking around a small 2d map. Instead of having 2 variables to store the current x and y values of the player position in a certain array, I want to make a 2d array that is filled with NULL pointers. Then the player would be represented as a...
Thanks for the reply.
Also, i was looking through the non-standard libraries that the compiler i use has, and noticed conio.h, i was wondering whether it would be better to just stick with conio or use curses? and if anyone would suggest curses, can you possibly tell me how to set it up? i use...
im looking for functions that do not require the user to press enter. such as, they press "a" and the program continues, instead of something like "a[enter]" when using scanf.
i know that it is possible to have multiple conditions in a for loop. but is it separated by a comma or would it be separated by && like in an if statement?
Thanks