# Search results

1. ### 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...
2. ### 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...
3. ### 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...
4. ### 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...
5. ### 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...
6. ### 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...
7. ### 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.
8. ### 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
9. ### 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...
10. ### 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...
11. ### 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...
12. ### 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...