Forum: Game Development Jan 26th, 2007 |
| Replies: 3 Views: 5,348 Hi guys,
Thanks a lot for your help. Niek_e was right about the second thing, I am trying to make a project in MS Visual C++ 6 which uses directX. I just needed help with configuring my compiler.... |
Forum: Game Development Jan 25th, 2007 |
| Replies: 3 Views: 5,348 Hi, can anyone tell me how to configure DirectX (December 2006) in MS visual C++ 6.0 please, or at least where or what to read to finally do it? I’m having a real hard time figuring this out
... |
Forum: C Jan 3rd, 2007 |
| Replies: 27 Views: 6,624 First of all, here is your code indented with some comments:
#include <stdio>
//void triangle(int n); // function prototype does not match the declaration. should be:
void render_triangle(int... |
Forum: C++ Dec 27th, 2006 |
| Replies: 9 Views: 2,602 I've read SAMS teach yourself C++ in 21 days and Herbert Schildt's C++ from the ground up. I honestly recommend the first one though as it's code is much clearer and easier to understand. The second... |
Forum: C++ Dec 11th, 2006 |
| Replies: 20 Views: 3,435 With Visual C++.. all my code is tested and always works before i post it. These people are simply boycotting me for their own reasons.
By the way, if i want do to post homework it doesnt have to... |
Forum: C++ Dec 10th, 2006 |
| Replies: 20 Views: 3,435 works fine for me.. Must be some differences with your compiler |
Forum: C++ Dec 7th, 2006 |
| Replies: 20 Views: 3,435 You can just do this. It checks through all the elements in the array and finds out each check which is the smallest, biggest and average value of the array so far. At the end you have your results
... |
Forum: C++ Nov 30th, 2006 |
| Replies: 4 Views: 1,308 You've got to understand you only need to be dealing with one instance of class Tollbooth. You declare 3 in your main! a,b,and toll.
Just a hint, you dont need any parameters in your accessor... |
Forum: C++ Nov 29th, 2006 |
| Replies: 11 Views: 1,936 int main() is used to return 0 at the end. This 0 is returned to the Operating system to denote that the function main() - which is the only function called by the operating system and that's why its... |
Forum: C++ Nov 29th, 2006 |
| Replies: 4 Views: 3,224 It works fine on my compiler :-S
Try declaring a boolean variable and have that in the while loop
bool keepLooping = true;
...
while (keepLooping)
{
... |
Forum: C++ Nov 29th, 2006 |
| Replies: 11 Views: 1,936 I've commented out your mistakes and placed the correct bits where necessary. I also commented what you had wrong. Its mostly syntax errors, nothing too bad, just keep a eye out for these things.... |
Forum: C++ Nov 29th, 2006 |
| Replies: 6 Views: 1,939 Yep, u need to use the index in your loop to make any sense of using it.. something like
for (index=0; index<NUM_PLAYERS; index++)
{
cout << "Name: " << players[index].name <<... |
Forum: IT Professionals' Lounge Nov 29th, 2006 |
| Replies: 13 Views: 2,996 I am not a newbie, i've been programming for years. I've recently got into C++! That's a big difference. I know my code is correct and I aways post it without warnings or errors.
Lets get this... |
Forum: IT Professionals' Lounge Nov 28th, 2006 |
| Replies: 13 Views: 2,996 Hey there s.o.s,
I totally understand your point of view but as you said, i'm not doing anything against the rules here. I respect the rules and try as much as I can to stay within the limits of... |
Forum: IT Professionals' Lounge Nov 28th, 2006 |
| Replies: 13 Views: 2,996 << This thread is split off from a discussion that originated here: 62976 >>
Here;s something you can work on. It may not be exactly what you need but its a basis at least. Also, why do you need... |
Forum: C++ Nov 28th, 2006 |
| Replies: 10 Views: 3,531 Here;s something you can work on. It may not be exactly what you need but its a basis at least. Also, why do you need to check if the second number of the division is zero, from the second you say it... |
Forum: C++ Nov 27th, 2006 |
| Replies: 10 Views: 9,431 Ye sure i mean whatever floats your boat.. There are many ways of solving a problem. We already gave two and agree totally with both! Its a matter of convenience, style, readability and efficiency... |
Forum: C++ Nov 27th, 2006 |
| Replies: 10 Views: 9,431 Of course, i just noticed. The parameter PlayerChoice in the function CheckWinner should be of type Choice but it still works this way as well. Please change it though, it should be
void... |
Forum: C++ Nov 27th, 2006 |
| Replies: 10 Views: 9,431 Here's a working example i just wrote. I've also used the enum type you guys were talking about, plus i added another of my own. Study this well and u'll c what i was going for. Hope it helps, byee
... |
Forum: C++ Nov 17th, 2006 |
| Replies: 7 Views: 1,553 Here's a working solution. Ok what I did is:
1. Changed the sort algorithm from bubble to selection sort, passing the array in by reference.
2. Changed both sortArray and ShowArray functions to... |
Forum: C++ Nov 15th, 2006 |
| Replies: 6 Views: 1,522 #include <iostream>
using namespace std;
void function(char *name);
int main()
{
char string[20];
char *aString=string; |
Forum: C++ Nov 14th, 2006 |
| Replies: 2 Views: 2,071 Of my studying and understanding, Virtual Functions are used only for polymorphism. Use virtual functions ONLY if you know those functions wil be overloaded or overrided in derived classes. Don't... |
Forum: C++ Nov 13th, 2006 |
| Replies: 3 Views: 2,291 An easier way of doing this is something like:
#include<iostream>
#include<string>
using namespace std;
int main()
{
string myString = "momimom"; |
Forum: C++ Nov 13th, 2006 |
| Replies: 4 Views: 1,193 This is one way of handling it. Study it and you'll get your head around it. Hope it helps byeee
#include<iostream>
using namespace std;
int main()
{
int input;
int i; |
Forum: C++ Nov 13th, 2006 |
| Replies: 3 Views: 1,204 Here's a working solution. Study it hard and youl'l figure it out. Hope it helps byeee
//This progam accepts marks of 4 different subjects by 5 students.
//Then calculates the average score of... |
Forum: C++ Nov 12th, 2006 |
| Replies: 6 Views: 1,761 your code is fine man.. I enter 5 numbers (one for each type) and the output seems correct to me. Dont know what went wrong on your side?!?... |
Forum: C++ Nov 10th, 2006 |
| Replies: 9 Views: 3,991 int main() is used to return 0 at the end. This 0 is returned to the Operating system to denote that the function main() - which is the only function called by the operating system and that's why its... |
Forum: C++ Nov 9th, 2006 |
| Replies: 7 Views: 7,390 return 0 returns the number 0 (obviously.. hehe) to the Operating System. This is used to denote that the function main() was successfully completed. You can use void main() but as my friends above... |
Forum: C++ Nov 9th, 2006 |
| Replies: 10 Views: 1,717 I guess this problem is fixed. The final code should look something like:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
// prototypes
float... |
Forum: C++ Nov 9th, 2006 |
| Replies: 3 Views: 1,497 you can use system("cls") but that will clear the entire screen, not just a part of it. Beware that this is an OS command though |
Forum: C Nov 9th, 2006 |
| Replies: 4 Views: 4,042 long integers also have a maximum value. They are made up of 4 bytes (32bits) (depending on each pc) and can only hold upto a certain number. If you try to go past this number you will wrap around... |
Forum: C++ Nov 9th, 2006 |
| Replies: 7 Views: 7,390 yep thats fine.. also make sure you return 0 when you declare int main(), otherwise declare void main()
The final program should look like this: (I changed the name of the function perfect(...) to... |
Forum: C++ Nov 6th, 2006 |
| Replies: 4 Views: 1,490 Here's how its supposed to handle. Check it out and hope it helps
#include <iostream>
using namespace std;
int main()
{
int num1=0;
int num2=0;
int quotient=0; |
Forum: C Nov 6th, 2006 |
| Replies: 8 Views: 1,939 sorry, not (n<0) to check if empty, but (n==0)... |
Forum: C Nov 6th, 2006 |
| Replies: 8 Views: 1,939 This is how to implement your function. Check it out, hope it helps
int indexOfMin(const string a[], int n) // i'm assuming n is the number of
{ ... |
Forum: C++ Nov 3rd, 2006 |
| Replies: 20 Views: 4,711 I am guilty of this, I'll be honest. I know it is important to indent and indent properly, it is industry standard, and it is simply utilitarian.
Well sharky_machine... |
Forum: C++ Nov 2nd, 2006 |
| Replies: 3 Views: 1,195 Sorry, you need the {num,num,num} 5 times here, not 3:
int val [NUMROWS][NUMCOLS] = {{num,num,num},{num,num,num},{num,num,num},{num,num,num},{num,num,num}}; |
Forum: C++ Nov 2nd, 2006 |
| Replies: 4 Views: 4,127 Here's something that you might find useful. Because the description of the problem isnt really the clearest it could be, I made this little program up to help you understand what should happen. Its... |
Forum: C++ Nov 2nd, 2006 |
| Replies: 3 Views: 1,195 Here's the code. You dont really need the last two #includes in the program.. Not sure if you needed them for later though..
#include<iostream>
#include<iomanip>
using namespace std;
int... |
Forum: C Nov 2nd, 2006 |
| Replies: 2 Views: 1,097 if you're using C++:
1st thing to do:
#include <fstream>
2nd thing open the file for output obviously if you're going to append and change the default behaviour of ofstream:
ofstream... |