General C++ Programming - September 2013 (Page 18)

OpenGL and 2D Games
 
I'm just wondering how anyone can make 2D games in OpenGL. I have sprites, but when I load them in game, they're all big and stuff, not pixel for pixel how I'd ...
[16 replies] Last: outcoord.x = (pixelcoord.x / 400.0) - 1.0; outcoord.y = (pixelcoord.... (by Luke Stones)
Would learning python make C++ easier to learn?
 
Well i want to learn both python and C++. I started C++ already. But i heard the first language you learn is always more difficult. But also python is relativ...
[7 replies] Last: It could, help you understand code. But would not help in learning c++ (by Luke Stones)
Why does the following code crash when i run it{linked lists}
 
#include <iostream> #include <cstdlib> #include <ctime> #include <fstream> #include <vector> using namespace std; vector<float> csv_input; struc...
[3 replies] Last: Compile it, and then type the debug code. :) (by Luke Stones)
Skybox
 
I'm unsure how I would map a texture like this to a cube model. How would I? http://www.tutorialsforblender3d.com/Textures/Skys/Sky_Box_1.html
[7 replies] Last: Make this into a Rect Shape, then you can declare. (by Luke Stones)
Help with a calculator
 
Here is my currently active code: int num1; int num2; char choice; int answer; char choice2; bool MoveOn; bool ActiveAnswer; // get first number ...
[5 replies] Last: Line 22 has got a indented comment. (by Luke Stones)
hi, we have a project to Modify the FRONT.c include the name of the token/Lexeme after the analysis. thanx in advance
 
I already have a file "FRONT" - which contains arithmetic operations a = a+b+(c*d) here is the code of FRONT.C ---------------- //front.c - a lexi...
[6 replies] Last: hi, Luke do you have a sample code on how to include the name of the t... (by james2013)
Pointers - * operator
 
We use the * operator to obtain and modify the value of the variable being pointed to by the pointer however, we don't use this operator while making arrays usi...
[2 replies] Last: OK ! I understood ....Thanks ! (by gravity0905)
Help with do...while loop. Expected while?
 
Please copy these code to your compiler and help me figure it out, I don't know what's wrong with it. I spent 3 hours to find solution and seems better to find ...
[3 replies] Last: Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I didn't... (by drinkinpeki)
How can I read one number at a time from an int file?
 
Hi all, I have a file called example.txt . In that file, the int 123456 is stored. How can I read one independent number from that int? Lets say, I have an ...
[4 replies] Last: If you look at the ASCII table you will see that the ASCII code for t... (by ajh32)
Help with my bool logic for date validation
 
Hey guys, I have a problem I need some help with. I pretty much have the problem complete. My issue is regardless of which date I input its always defaulting t...
[4 replies] Last: Try with doing if (isDateValid (month, day, year)) Then after have a ... (by Luke Stones)
basic programming skills
 
Where would one look to learn the general basics of any programming language? I.e. what components make up a program, general etiquette of code etc.
[6 replies] Last: The best I can say is to read your book from beginning to end and actu... (by newbieg)
How can I count the unique words in a program?
 
CSCI-15 Assignment #2, String processing. (60 points) Due 9/23/13 You MAY NOT use C++ string objects for anything in this program. Write a C++ program t...
[2 replies] Last: This is a pretty significant homework assignment. Yes, you need to k... (by Duthomhas)
Casting question
 
Hi programmers... I have a problem that is twisting my mind a lot... I'm working on a program called "Animal Shelter", that will hold Cats and Dogs using ...
[16 replies] Last: @ ne555 Sorry for the late reply, have been a bit busy. Realised th... (by TheIdeasMan)
binary search and sequential search algorithm
 
Write a program to find the number of comparisons using the binary search and sequential search algorithms //main.cpp #include <cstdlib> #include <iostrea...
[4 replies] Last: Ok, that doesn't say anything about writing your own containers. It t... (by kbw)
by Techz
Help with string input AND output to file
 
I'm trying to write a simple program that will prompt for a string typed in by keyboard and save it to a file. I've tried lots of variations and this is just th...
[2 replies] Last: Thought I was doing both: input from the keyboard, output to the file.... (by Techz)
Space game rotation
 
i am making a space game using sfml 2.0. i want it to move depending on its rotation. so if it is rotated 20 degrees it move in the direction it is facing. how ...
[17 replies] Last: fun2code's solution worked thank you (by Cronnoc)
function pointers
 
Its been a while since I did C++, and I'm having some trouble making use of an existing library. The declarations are as follows: typedef void *Ptr; // Gene...
[3 replies] Last: ty for the quick replies. I've worked it out succesfully. :) (by ryushinaka)
by Cinolt
Adding a "sorted insert" method to std::list
 
I need a std::list but I need its contents sorted upon insertion. First thing that comes to mind is deriving a class from std::list and then just adding the de...
[2 replies] Last: Thanks, I've just never seen that syntax before. I'm not exactly sure... (by Cinolt)
Refactoring giant c++ class
 
Hello all, I'm improving and adding code to a testing class written by someone else. The class has 7 different test functions and each call some auxiliary funct...
[no replies]
threas
 
template<typename F > sf::Thread::Thread ( F function ) Construct the thread from a functor with no argument. This constructor works for function o...
[6 replies] Last: The first error is because you don't pass functions by reference like... (by cire)
September 2013 Pages: 1... 1617181920... 36
  Archived months: [aug2013] [oct2013]

This is an archived page. To post a new message, go to the current page.