Search results

  1. P

    C/++/# C++ Collision Detection Issue

    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...
  2. P

    C/++/# C++ Collision Detection Issue

    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...
  3. P

    C/++/# [C++] g++ compiler issues

    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.
  4. P

    C/++/# [C++] g++ compiler issues

    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...
  5. P

    C/++/# C++ Vectors

    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...
  6. P

    Principle of Work and Energy

    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. Im thinking it depends on mB.
  7. P

    Principle of Work and Energy: Spring and Mass

    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...
  8. P

    Principle of Work and Energy

    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...
  9. P

    C: 2D arrays with structs and pointers

    Yes, it's working. Thanks for the help.
  10. P

    C: 2D arrays with structs and pointers

    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...
  11. P

    C: 2D arrays with structs and pointers

    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?
  12. P

    C: 2D arrays with structs and pointers

    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...
  13. P

    C - getting input

    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...
  14. P

    C - getting input

    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.
  15. P

    For Loop Conditions in C

    i know that it is possible to have multiple conditions in a for loop. but is it seperated by a comma or would it be seperated by && like in an if statement? Thanks
  16. P

    Confusion about scanf

    Homework Statement The problem that was given was to prompt the user to type words with no spaces in between, and end it by pressing enter. From there, the program would calculate which letter comes the latest in the alphabet and is included in what the user types in. example. user types...
  17. P

    C Library Problem

    Thanks for the answer, that cleared it up for me.
  18. P

    C Library Problem

    I was working on an assignment and i needed to use a constant that is defined in the math.h library (M_E). But when i tried to use it, the compiler took it as a normal variable that had not been initialized or anything. So my question is, is this just because of the compiler i was using, or is...
  19. P

    Question about Torque

    Out of curiosity, I decided that I would build a Tesla Turbine and possibly use it for some interesting contraption. Except, when I was reading about it, I always heard that it can achieve high RPM, but has low torque. I was just wondering if someone would be able to explain the concept of...
  20. P

    Physics Project involving ice, gases, and global warming

    its alright ill just have to hope that the theory part of what it does will suffice for it thanks for trying either way
  21. P

    Physics Project involving ice, gases, and global warming

    to tell the truth, i dont think that it will be possible to effectively calculate the rate at which it melts and all that since it is impossible to get conclusive numbers on the amount ocean water, temperatures, size of the clathrates and other things. instead, can anyone tell me if there is...
  22. P

    Physics Project involving ice, gases, and global warming

    from water to the ice i was reading about newtons law of cooling or something like that, but i couldnt really find a heat transfer coefficient also when it comes to calculations, my teacher said to use 1 kg of the methane clathrate since it is relatively unknown exactly how much of it there is...
  23. P

    Physics Project involving ice, gases, and global warming

    Alright, ASSIGNMENT it is required of me to to the physics part in a group project where the topic is "causes of global warming". my group has chosen methane clathrates or methane hydrates if you like (in the ocean, not on land). The way these work is that it is methane gas that is trapped in...
Top