Forum: C++ 24 Days Ago |
| Replies: 4 Views: 221 How do those hexadecimal numbers store? do they store as integer or string? |
Forum: C++ 31 Days Ago |
| Replies: 4 Views: 551 Well, maybe you didn't get my message from my post at all. First index of an array is 0. xData[xMax - xMin] equals to xData[20] because xMax - xMin = 20. So allowed index should be in range of 0 to... |
Forum: C++ 32 Days Ago |
| Replies: 4 Views: 551 int xMin = -10;
int xMax = 10;
double xData[xMax - xMin];
xData contains 20 elements starting from 0 to 19.
int counter = xMin;
for (counter; counter <=xMax; counter++) { |
Forum: C++ Sep 20th, 2009 |
| Replies: 82 Views: 16,185 May I add another algorithm that does not use log and power function; yet still run relatively fast. This function makes use of fast inverse square root algorithm... |
Forum: C++ Sep 20th, 2009 |
| Replies: 6 Views: 1,539 It is hard to suggest any project when we don't even know what have you learned and what are you capable of. |
Forum: C++ Aug 4th, 2009 |
| Replies: 24 Views: 773 My bad :(
You are totally right. |
Forum: C++ Aug 4th, 2009 |
| Replies: 24 Views: 773 You can't simply compare 2 strings with operator ==. There is a function in library <string> called strcmp().
Syntax:
int strcmp(string1, string2)
Return:
Return 1 if string1 >... |
Forum: C++ Aug 4th, 2009 |
| Replies: 3 Views: 213 Sorting concept is simple: from the least to the greatest or from the greatest to the least. To do so, you need to do comparison. So, the magic trick is comparison-rule (which is greater and which is... |
Forum: C++ Aug 3rd, 2009 |
| Replies: 5 Views: 1,335 You can also use smart-pointer technique.
template <class T>
class auto_ptr
{
private:
T* ptr;
public:
explicit auto_ptr(T* p = 0) : ptr(p) {} |
Forum: C++ Aug 2nd, 2009 |
| Replies: 6 Views: 442 If you truly understand the concept of doubly-linked list, these problems would be very easy. Lets start with basic doubly-linked list concept. Doubly-linked list data structure consist of 3... |
Forum: C++ Jun 29th, 2009 |
| Replies: 3 Views: 215 while (tryanother = 'y')
Change = to == |
Forum: C++ Jun 27th, 2009 |
| Replies: 13 Views: 578 Initializing the elements of an array a1 and size n randomly, so that its elements have values between [1-45].
I think the assignment want us to create an array with random size in runtime. |
Forum: C++ Jun 27th, 2009 |
| Replies: 13 Views: 578 Posting the whole assignment will not help you or help us know what you have problem with. If you do not understand the logic, tell us which part that you don't understand. Tell us more about what... |
Forum: C++ Nov 15th, 2008 |
| Replies: 2 Views: 1,006 That works perfectly. Thank very much :) |
Forum: C++ Nov 15th, 2008 |
| Replies: 2 Views: 1,006 I am trying to make a simple engine with WinAPI and I encounter this problem:
class Window {
....
public:
static HINSTANCE hInst;
....
};
.... |
Forum: C++ Nov 12th, 2008 |
| Replies: 3 Views: 2,124 |
Forum: C++ Nov 11th, 2008 |
| Replies: 4 Views: 570 Why don't you do it on your own instead of copying someone else code? |
Forum: C++ Aug 26th, 2008 |
| Replies: 12 Views: 1,185 Blender3D is a 3d modeling tool, while Game Blender (http://en.wikipedia.org/wiki/Game_Blender) is a tool to create a 3d application. |
Forum: C++ Aug 25th, 2008 |
| Replies: 9 Views: 703 Please explain it more clearly. I don't seem to understand what are you trying to do. |
Forum: C++ Aug 17th, 2008 |
| Replies: 14 Views: 1,753 Do as what Edward has said and you will able to solve your problem easily. You don't actually need integer to store number, you can just use string to represent the number. First of all, you create... |
Forum: C++ Aug 15th, 2008 |
| Replies: 6 Views: 532 Edit: you have editted during I was replying.
Anyway, you can simply use our code. |
Forum: C++ Aug 15th, 2008 |
| Replies: 6 Views: 532 How about try this code:
#include <iostream>
int main()
{
std::cout << "Hello World";
std::cin.get();
return 0; |
Forum: C++ Aug 15th, 2008 |
| Replies: 2 Views: 337 We don't even know what is your project? and what were your problems with the project. At least, give us more detail about your project and what you have done so far. |
Forum: C++ Aug 15th, 2008 |
| Replies: 13 Views: 2,563 It is quite simple. User input the value into number not A[number]. So it should be sum = sum + number. |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 To exit the program, you need to return exitcode to the operator system simliarly to the returning value to main() function. The reason that return 0; in your gameOver() function doesn't work because... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 6 Views: 685 First of all, getch() need header <conio.h> if my memory serve my right. However, getch(), somehow, was not recommended to use. |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 LearnCPP (http://www.learncpp.com/), this site has a good free C++ tutorial. Totally recommended. |
Forum: C++ Jul 22nd, 2008 |
| Replies: 6 Views: 685 You might wonder why your problem hasn't been answered. It is obvious that you haven't use the code tag which make it very unfriendly to read your code. I recommend you to tag your code and post your... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 Remember, = is a assign operator while == is an equal operator. I give you 2 examples so that it might give you more idea.
Example 1:
int a = 5; // you assign variable a with value 5.
if (a =... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 Did you choose "Console Project" or "Win32 Project"? |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 Like I have told you. Posting those error messages after you delete that line and it would be better if you post the exact code after your delete that line. It is hard to talk thing blindly. |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 using namespace std;
int main();
char board[3][3];
You have forgotten to put the semi-colon to your main() function declaration. Anyway, I don't think it is neccessary to declare the main... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 40 Views: 2,191 It is better if you post the exact code and the exact error messages in here. |
Forum: C++ Jul 22nd, 2008 |
| Replies: 24 Views: 62,875 Text-based Role-Playing Game Project (For Beginners)
Firstly, this game will start with an introductatory storyline of the game to attract player interest. Then, it asks a player to enter his or her... |
Forum: C++ Jul 21st, 2008 |
| Replies: 40 Views: 2,191 |
Forum: C++ Jul 21st, 2008 |
| Replies: 40 Views: 2,191 switch (letterNum)
{
case '1':
board[0][0] = 'X';
break;
case '2':
board[0][1] = 'X';
break; |
Forum: C++ Jul 21st, 2008 |
| Replies: 40 Views: 2,191 So what is your question? |
Forum: C++ Jul 19th, 2008 |
| Replies: 8 Views: 816 int a = 46, b = 3, c;
for (c = 0; a >= b; c++)
a -= b;
// in the end, a will be remainder, c will be the result of the division. |
Forum: C++ Jul 17th, 2008 |
| Replies: 8 Views: 816 Mathematically, you can just constantly substract the dividend with divisor and count it until the dividend become smaller than the divisor. If dividend become 0 after it's been constantly... |
Forum: C++ Jul 17th, 2008 |
| Replies: 6 Views: 978 Of course you can have multiple of them. However, try to avoid using it as much as possible since most of the time goto can be replaced with a loop. For some case such as break multiple-level of... |