Forum: C++ Jul 8th, 2009 |
| Replies: 6 Views: 322 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: 6 Views: 595 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: 595 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 2nd, 2009 |
| Replies: 13 Views: 526 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: 526 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,477 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: 6 Views: 325 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++ Jun 30th, 2009 |
| Replies: 14 Views: 633 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 29th, 2009 |
| Replies: 6 Views: 1,440 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: 3 Views: 371 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: 6 Views: 1,440 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 27th, 2009 |
| Replies: 18 Views: 751 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: 581 Size randomly? Then it would be completely different, you would probably use a pointer. |
Forum: C++ Jun 27th, 2009 |
| Replies: 13 Views: 581 Example 1:
#include <iostream>
using namespace std;
int main()
{
int ar[10],a;
for(a=0;a<10;a++)
{ |
Forum: C++ Jan 31st, 2009 |
| Replies: 4 Views: 366 Well i would start by learning how to make objects on the screen. Then make a Square class, Circle class, and Triangle class. And have functions that allow them to move, and get their position. Then... |
Forum: C++ Jan 10th, 2009 |
| Replies: 4 Views: 815 int main()
{
char input[256];
cout << "Insert name: ";
cin.getline(input,256);
cout << "\nYou name is " << (int)strlen(input) << " characters long.\n";
cin.ignore();
... |
Forum: C++ Jan 5th, 2009 |
| Replies: 12 Views: 713 i also edited some other problems, the one on my post is complete fixing a bunch of problems u had, also try next time you program, not to use goto's, figure out a way around them. : ) |
Forum: C++ Jan 5th, 2009 |
| Replies: 12 Views: 713 lol dumb error np : /
eh if u dident notice i changed it in the quote ^^
also a few errors..
you are adding stuff to the file before u checked if it was open.
and you closed it and then... |
Forum: C++ Jan 3rd, 2009 |
| Replies: 15 Views: 657 dono what this does really but who knows its worth a try
if(tfgame.ToggleWarhead == True)
{
SMNameArray[6] = "Warhead (3000/180)";
... |
Forum: C++ Dec 31st, 2008 |
| Replies: 10 Views: 1,317 As chris said, i used that, and enhanced your program
hope it works:
#include <windows.h>
#include <iostream>
#include <cstdlib>
void MoveMouse(int x,int y);
using namespace std; |
Forum: C++ Dec 31st, 2008 |
| Replies: 9 Views: 558 #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
string LogicMolecule;
string ExecutableCodeName; |
Forum: C++ Dec 31st, 2008 |
| Replies: 4 Views: 429 do you want all the numbers together? or only 1 at a time and get it into an array...
Here's what i did
get it as a string
char line[2500];
ifstream num("num.txt");
num.getline(line,2500);... |