- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
9 Posted Topics
Re: Ok so you have 2 options here if you want to "move around the object". 1. Use gluLookAt() to change the camera position and move it around the object. If the ojbect is centered in the middle of your virtual window you can use something like this: [CODE] /* Spherical … | |
Re: What exactly is the assignment? Because everything you are trying to code here already exists in the standard template library (STL). More specifically in the [URL="http://www.cplusplus.com/reference/stl/list/"]list container. [/URL] | |
Re: Map info: [url]http://www.cplusplus.com/reference/stl/map/[/url] It'll work but another (perhaps less effective solution) is to use string.compare() to compare words from your file against reserved words. However this will take a lot more ressources and is far from effective. Just pointing out another way to do it. | |
Re: Just like firstPerson I suggest using the string type instead of char. To access each individual character you can use the following syntax: [CODE] string line; char firstchar = line[0]; [/CODE] You can use a loop to get each char. Something like: [CODE] for(int i=0; i < line.size(); i++) { … | |
Re: Use a string for the name instead of char and if you want to allow spaces use getline(cin, name) instead of cin. | |
Re: I would do something like that: (Note this code might not work.. Didn't test it and don't really have time to.. But you should get the idea) [CODE] #include <iostream> #include <fstream> using namespace std; int main() { ifstream file; file.open("scores.txt"); if(file.fail()) { cout << "Problem opening the file" << … | |
Re: Line 39 remove void. Only have to specify the function type when you declare it, not when you [I]call[/I] it. | |
Re: One way to do it (which is a sucky way really) is to compare each character of your string (string[0], string[1], etc) with numbers from 0 to 9 in a for loop. Quickly.. (for i=0; "condition here"; i++) if(string[i] == '0' || string[i] == '1'... ) counter++; Really lame way … | |
Re: [QUOTE]My question is when I input .25 three times (which is .75) it breaks out of the loop and doesn't update the slot amount total.[/QUOTE] It breaks out of the loop because of your if statement: [CODE] if(total>=.75) { cout<<" Here is your Cola!"<<endl<<endl<<endl; cout<<" Have a nice day!"<<endl; break; … |
The End.