Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] #include Problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Wed May 28, 2008 9:28 pm    Post subject: [C++] #include Problem Reply with quote

Hey Guys,
When i try to compile this code:
Code:
#include <iostream.h>
#include <iomanip.h>
#include <fstreamh.h>

//Functions Prototypes
int displayLine();
float calcSquare(float);
float calcHalf(float);

int main()
{
   //Declare And Initialize Variables
   float numberInput = 0.0;
   float numberSquared = 0.0;
   float numberHalved = 0.0;

   //Accept Input From User
   cout << "Enter A Number: ";
   cin >> numberInput;

   //Call Functions To Do Calculations
   numberSquared = calcSquare(numberInput);
   numberHalved = calcHalf(numberInput);
   
   ofstream outFile;
   outFile.open("Beginner Program1.dat");

   //Display Output Items
   displayLine();
   cout << setprecision(2) << setiosflags(ios::fixed|ios::showpoint);

   cout << "Result of Calculations" << endl;
   outFile << "Result of Calculations" << endl;
   cout << "Square of Number: " << numberSquared << endl;
    outFile << "Square of Number: " << numberSquared << endl;
   cout << "Half of Number: " << numberHalved << endl;
   outFile << "Half of Number: " << numberHalved << endl;
   displayLine();
}

int displayLine();
{
   cout << "----------------------------------------"
}
It returns an error because there is no such file or directory for the .h in the includes, but when i take out the .h everything they are meant to support is now undeclared, so is there like a code for these includes that i might need?

Thanks Alot

_________________
Back to top
View user's profile Send private message AIM Address
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Wed May 28, 2008 9:34 pm    Post subject: Reply with quote

If there is no such file or directory, then you're missing those files. Google, download, put them in your includ directory.
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed May 28, 2008 9:39 pm    Post subject: Reply with quote

Did you download the sdk?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Wed May 28, 2008 9:39 pm    Post subject: Reply with quote

Code:
//Here are some fixes
#include<iostream>
#include<fstream.h>
using namespace std;

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Wed May 28, 2008 9:44 pm    Post subject: Reply with quote

I was told by wiccaan using namespace std; is a waste instead use std:: infront of cin and cout



@ Half Prime, Would i have to do this every time i code?

_________________
Back to top
View user's profile Send private message AIM Address
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Wed May 28, 2008 9:52 pm    Post subject: Reply with quote

No, you wouldn't. These are files used by the compiler that it has to have. You just have to put them in the include directory of your compiler, then you're set.
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed May 28, 2008 10:11 pm    Post subject: Reply with quote

Mussy69 wrote:
I was told by wiccaan using namespace std; is a waste instead use std:: infront of cin and cout



@ Half Prime, Would i have to do this every time i code?


It's only a waste if you're only using cin and cout. I put it anyway, but you don't need to use the whole namespace when your only using two functions in the namespace you may as well just put std::cout std::cin.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Wed May 28, 2008 11:03 pm    Post subject: Reply with quote

So could you help me with these #includes? cuz i got no idea where to download it from or where to put it when i do download it Shocked
_________________
Back to top
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu May 29, 2008 4:48 am    Post subject: Reply with quote

Download the Microsoft SDK from the other thread wiccaan posted it in. Then go to the options and find VC++ Directories or something like that and add the *SDK Location*\Include Folder to the list of includes and in the *SDK Location*\Lib to the list of lib's and finally add *SDK Location*\bin to the list of Executable files
_________________
Back to top
View user's profile Send private message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Sat May 31, 2008 2:00 am    Post subject: Reply with quote

Uhh it didnt work because like all the others have $(something/something)path and i dont no what it is for this one so could someone help me with that?
_________________
Back to top
View user's profile Send private message AIM Address
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sat May 31, 2008 10:14 am    Post subject: Reply with quote

I didn't understand all that, but I tihnk you don't know where the VC lib/include directories are? Go into options, it should be in there. Other than that, go to the VC directory and there should be lib and include directories.
_________________
Back to top
View user's profile Send private message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Sun Jun 01, 2008 11:31 pm    Post subject: Reply with quote

no my options is missing it but in the vc directory every other directory starts like $(whatever/whatever)directory, i dont no what the lib/include directory are if it has to include the $(whatever/whatever)directory
_________________
Back to top
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Jun 02, 2008 12:29 am    Post subject: Reply with quote

Examples of using SDKs. Do that for the normal SDK. I used the DirectX SDK as an example.






_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites