Forum: C++ Nov 8th, 2009 |
| Replies: 1 Views: 298 I'm sorry, I can't help you if I don't even see the class. Please post the contents of String2.cpp
I'm assuming the class is named String? You probably get an error where it says "**** this is where... |
Forum: C++ Nov 8th, 2009 |
| Replies: 4 Views: 456 #define MAX_LENGTH 256
int main(void) {
char userInput[MAX_LENGTH]; // use a character array not string
cout << "Enter a string to be converted:" << endl;
... |
Forum: C++ Jul 10th, 2009 |
| Replies: 1 Views: 184 CString is extict because it is from MFC which is extinct, they may have it available but it is not up to date with everything. Any bugs that they had when they were out are still there. There is no... |
Forum: C++ Jul 8th, 2009 |
| Replies: 6 Views: 374 I don't expect febonacci numbers to be negative, so why not use unsigned, it will give you twice the amount you can go.
And %d calls an integer, not a long (so it will only show what an integer... |
Forum: C++ Jul 6th, 2009 |
| Replies: 2 Views: 297 Some compilers that are stupid the gaurds still wont work, if that is so try using pragma once at the top.
#pragma once |
Forum: C++ Jul 6th, 2009 |
| Replies: 6 Views: 616 Which is why you retrieve the input with a string (because a string can handle any text input) and turn it into an integer if its valid. |
Forum: C++ Jul 6th, 2009 |
| Replies: 6 Views: 616 The atoi function returns an integer from a string. So:
char buf[256];
// Ask for input here
cin.getline(buf,256);
int num = atoi(buf);
if(num == 0)
cout << "Error"; |
Forum: C++ Jul 3rd, 2009 |
| Replies: 4 Views: 301 Your going to have to provide us with the GeneralTreeNode class please.
------------ edit -----------------
oh its a structure didn't see.. one sec lemme look this over again.
------------ edit... |
Forum: C++ Jul 3rd, 2009 |
| Replies: 4 Views: 271 I didn't really look at anything accept for the main function. Wouldn't it make sense to have a loop? It looks like your only calling the human to move once, then the computer the move once. Then the... |
Forum: C++ Jul 3rd, 2009 |
| Replies: 3 Views: 287 First of all, please surround your code with code tags or it makes it very hard for us to read. Second I would do this with array's, it seems it would make more sense, but this is an assignment..... |
Forum: C++ Jul 2nd, 2009 |
| Replies: 13 Views: 545 O Sorry, it don't let me edit now -.-
Here:
int **array;
int sizeX,sizeY;
sizeX = 5; // set to whatever
sizeY = 5; // set to whatever
array = new int*[sizeY];
for(int i = 0; i < sizeY; i++)... |
Forum: C++ Jul 2nd, 2009 |
| Replies: 13 Views: 545 I would recommend:
int **array;
int sizeX,sizeY;
sizeX = 5; // set to whatever
sizeY = 5; // set to whatever
array = new int*[sizeY];
for(int i = 0; i < sizeY; i++)
array[i] = new... |
Forum: C++ Jul 1st, 2009 |
| Replies: 30 Views: 1,528 I once tried to do something like this with ONLY C++. Tried to take all the contents of a document and remake it with the same thing. The problem is though that there are some characters that may not... |
Forum: C++ Jul 1st, 2009 |
| Replies: 10 Views: 354 string str = "This is a sentence.";
string newStr;
int len = 0;
for(int i = 0; i < str.len; i++)
{
newStr += str[i];
if(str[i] == ' ')
while(str[++i] == ' ')
... |
Forum: C++ Jul 1st, 2009 |
| Replies: 2 Views: 403 I know that, I always find that books are better... Anyone know a good book on WindowsAPI ? |
Forum: C++ Jul 1st, 2009 |
| Replies: 2 Views: 276 Couldn't Find much there :/ |
Forum: C++ Jul 1st, 2009 |
| Replies: 2 Views: 403 Hey guys,
I've been programming in consoles/visual C++. But i've been wanting to learn WindowsAPI programming WITHOUT the stupid visual interface for a while now. Could someone provide me some... |
Forum: C++ Jul 1st, 2009 |
| Replies: 4 Views: 572 I would help you but you see. I'm only a beginner to Network Programming myself. I still have failed to find a good tutorial. When i try to compile it on DevC++ None of the headers are recognized.... |
Forum: C++ Jul 1st, 2009 |
| Replies: 6 Views: 542 It is call-by Reference but you didn't use a reference anywhere.
--------- Edit ---------
Heh angi, you posted right before me -.- |
Forum: C++ Jul 1st, 2009 |
| Replies: 6 Views: 335 You won't be reinventing the wheel if your using dlls from other software to make it. It will just basically be organizing and making your own GUI. If you really want to "Reinvent the Wheel" then... |
Forum: C++ Jul 1st, 2009 |
| Replies: 4 Views: 572 Please wrap your code in code tags with:
[code=cplusplus]
and a closing tag
[/ code] (without the space)
and also, being new to programming, why would you start on networking? Why not try... |
Forum: C++ Jul 1st, 2009 |
| Replies: 2 Views: 276 I am interested in making my own Hide to Tray program that will hide any program i choose to the tray. I already know how I'm going to do it.. all i need is to know how to hide another window.
In... |
Forum: C++ Jun 30th, 2009 |
| Replies: 2 Views: 229 That is what i was talking about that attached to the process. But this doesn't explain it much its just source, but I will continue to look into it. If anyone has any other links. Please? |
Forum: C++ Jun 30th, 2009 |
| Replies: 2 Views: 229 Hey guys,
I was looking at a program that "extended" taskmanager by attaching a dll to the taskmanager's process. I was wondering how this is done and how they were able to add new features and... |
Forum: C++ Jun 30th, 2009 |
| Replies: 14 Views: 642 Ask the person you got the source from what compiler they used, then get that compiler and use it to compiler. OR look through the errors, try and fix them. For example: In Visual Studio you write:
... |
Forum: C++ Jun 30th, 2009 |
| Replies: 10 Views: 451 The output would be:
PersonOne's First name is: John
PersonOne's Last name is: Doe
PersonOne's Birthday is: 12/30/1978
PersonOne's Phone number is: 5855555
Then it will exit right... |
Forum: C++ Jun 29th, 2009 |
| Replies: 7 Views: 676 Try using . instead of -> |
Forum: C++ Jun 29th, 2009 |
| Replies: 6 Views: 1,601 I remember looking all over for something like that but i don't think it exists... Not to worry! All windows operating systems from VISTA and above have the .NET framework already installed on it...... |
Forum: C++ Jun 29th, 2009 |
| Replies: 6 Views: 527 Your going to have to make an array of 5 to store the inputs in so...
int nums[MAXNUMS];
count = 0;
// get input
while(count < MAXNUMS)
{
cout << "Num: ";
cin >> nums[count];
... |
Forum: C++ Jun 29th, 2009 |
| Replies: 3 Views: 400 because find was never defined it was defined inside a class you gotta make an object from that class and call it from the object.
AKA
search s;
s.find(unsigned mycstring, lett); |
Forum: C++ Jun 29th, 2009 |
| Replies: 9 Views: 712 You better mark this is solved or your gonna start getting some spamming... But if you ask me it's probably a glitch with windows.. :/ But yes i agree it is VERY strange. normally when that happens... |
Forum: C++ Jun 29th, 2009 |
| Replies: 6 Views: 1,601 The only problem with Visual 2008's compiled files is that you cannot run it on other machines without the .NET framework. I recommend finding a way to get it to work without the .NET framework or... |
Forum: C++ Jun 29th, 2009 |
| Replies: 4 Views: 237 The only other thing i can think of is that the file's text IS being updated, but you didn't retreive the updated text into the program. So maybe make a timer or make a button that will update the... |
Forum: C++ Jun 29th, 2009 |
| Replies: 3 Views: 731 Tom explained it very well but just a few more things:
If you don't already know what a namespace is: it is defined with namespace <name>. It's used to group certain things that are similar to each... |
Forum: C++ Jun 29th, 2009 |
| Replies: 4 Views: 237 It may be a glitch in the way you read files. First make sure in your code every time you open a file you close it. Then restart your system and try to run the program again. If it did not close the... |
Forum: C++ Jun 27th, 2009 |
| Replies: 7 Views: 438 Like it says above you will NEED to add restrictions or it will be impossible :/. To make the AI I would make it so that you keep the center of the computers bar aligned along the Y axis with the... |
Forum: C++ Jun 27th, 2009 |
| Replies: 18 Views: 789 I honestly prefer basic console programming, you don't have to worry about registering windows classes and checking 18billion errors. If your going to use windows GUI then get a Microsoft compiler... |
Forum: C++ Jun 27th, 2009 |
| Replies: 13 Views: 605 Size randomly? Then it would be completely different, you would probably use a pointer. |
Forum: C++ Jun 27th, 2009 |
| Replies: 1 Views: 223 I made a game, and my friend told me: It doesn't work on linux. I thought it was because when you use VK_SOMETHING that is a value that windows returns when that key is clicked. So... Is their a... |
Forum: C++ Jun 27th, 2009 |
| Replies: 3 Views: 346 This may be just a problem with posting on the forum, but if you copied and pasted it another error is that in your code in the single character quotes (' ') you put two spaces. two spaces is two... |