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 


Some help needed

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

Joined: 28 Aug 2008
Posts: 161
Location: Singapore

PostPosted: Thu Nov 27, 2008 2:17 am    Post subject: Some help needed Reply with quote

Code:

#include <iostream.h>
void calc ()
    {
     float num1;
     float num2;
     char op;
     float ans;
     cout << "Calculator!" << endl;
     cout << "Enter two numbers and perform an operation." << endl;
     cout << "Enjoy!!!!!!!!"
     cout << "Enter the first number and press ENTER:" << endl;
     cin >> num1;
     cout << "Enter the second number and press ENTER:" << endl
     cin >> num2;
     cout << "You entered " << num1 << "and" << num2 << endl;
     cout
         << "Press A followed by ENTER to subtract the two numbers."
         << endl
         << "Press S followed by ENTER to multiply the two numbers."
         << endl
         << "Press M followed by ENTER to multiply the two numbers."
         << endl
         << "Press D followed by ENTER to multiply the two numbers."
         << endl;
    cout << "---------------------------" << endl;
    cin >> op;
    if (op == 65)
    {
     ans = num1 + num2 ;
    }
    if (op == 83)
    {
     ans = num1 - num2;
    }
    (if op == 77)
    {
     ans = num1 * num2;
    }
    if (op == 68)
    {
      ans = num1 / num2;
    }
    cout << " The answer is " << and << endl;
    cout << "Thanks for using the Calculator." << endl;
    cout << "Application now exiting ..." << endl;
   }







I'm a 12 year old that trying to learn programming and i need some help. The error read:
Code: 800A0400
Source: Microsoft VBscript compilation error.

err i saved this as a .vbs using Ultraedit and its supposed to be a calculator or smth( learning from a manual ). Please Help! WIll +rep if helped!



sdaasdasd.png
 Description:
 Filesize:  15.54 KB
 Viewed:  4338 Time(s)

sdaasdasd.png


Back to top
View user's profile Send private message MSN Messenger
Frostbyt3
Master Cheater
Reputation: 0

Joined: 07 Jan 2008
Posts: 323
Location: Australia

PostPosted: Thu Nov 27, 2008 2:20 am    Post subject: Reply with quote

The problem is that it is not a VBScript.
What you need is a C++ IDE.You should try Visual C++ 2008 Express.
Back to top
View user's profile Send private message MSN Messenger
aasddsaadsasdasdasdassads
Expert Cheater
Reputation: 0

Joined: 28 Aug 2008
Posts: 161
Location: Singapore

PostPosted: Thu Nov 27, 2008 2:21 am    Post subject: huh Reply with quote

huh pls explain what i really need to do.
Back to top
View user's profile Send private message MSN Messenger
Frostbyt3
Master Cheater
Reputation: 0

Joined: 07 Jan 2008
Posts: 323
Location: Australia

PostPosted: Thu Nov 27, 2008 3:20 am    Post subject: Reply with quote

If you didn't get that, gee, I'm worried.
Download Visual C++ 2008
Install
New Project, Console Application
Delete all the code and paste that in. If that doesn't work, that code is dodgy. Which it is, cause I see why it is.

I'll give you a hint though. Calc wont be called(run) but main will.]
Back to top
View user's profile Send private message MSN Messenger
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Thu Nov 27, 2008 3:24 am    Post subject: Reply with quote

Frostbyt3 wrote:
I'll give you a hint though. Calc wont be called(run) but main will.]
/ENTRY:"calc" :)
Back to top
View user's profile Send private message
aasddsaadsasdasdasdassads
Expert Cheater
Reputation: 0

Joined: 28 Aug 2008
Posts: 161
Location: Singapore

PostPosted: Thu Nov 27, 2008 8:23 am    Post subject: Downloaded Reply with quote

I installed and dled, then?? I also changed calc to main
Back to top
View user's profile Send private message MSN Messenger
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Thu Nov 27, 2008 8:37 am    Post subject: Re: Downloaded Reply with quote

raprap30 wrote:
I installed and dled, then?? I also changed calc to main



Start a new project, write your code, compile and run.
Back to top
View user's profile Send private message MSN Messenger
aasddsaadsasdasdasdassads
Expert Cheater
Reputation: 0

Joined: 28 Aug 2008
Posts: 161
Location: Singapore

PostPosted: Thu Nov 27, 2008 8:49 am    Post subject: which kind of project Reply with quote

which kind of project?? btw i rename the thing to exe and they said that the ntvdm cpu has encountered an illegal instruction.
Back to top
View user's profile Send private message MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu Nov 27, 2008 8:57 am    Post subject: Reply with quote

Win32 Console.
Back to top
View user's profile Send private message
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Fri Nov 28, 2008 12:01 am    Post subject: Reply with quote

There are a few mistakes in the code.

Errors:
*Missing a few semi-colons
*#include <iostream>
not
#include <iostream.h>
*and to ans
*not using int main(). You could set the entry to that function, but that isn't part of the c++ standard
*the compiler will not know where cout, cin, or endl is coming or what it is. You would need to append std::. Else, you can either do
Code:

using std::cout;
using std::cin;
using std::endl;

or
Code:

using namespace std;

I do not recommend you do it this way. It's a bad programming habit. There's more to it, but since you are beginning, we'll leave it at that.

As for an IDE, get Visual Studio. There is a free edition of it.
http://www.microsoft.com/express/vc/Default.aspx
It has one of the best compilers and the debugger is top of the line (if you know how to use it).

I am sometimes required to tutor kids your age and from experience, I notice that age group tend to learn better by seeing it. So, I've made a little video to demonstrate how to create a project, add a source file, fix the errors, and how to run the program. I'm using the professional edition, so if you're using the express, you'll notice a difference in the layout. The file is a little too big (11.2mb) for an attachment, so I upped it to rapidshare. Encoded using xvid, so you will need that to watch it.
Code:

http://rapidshare.com/files/168123399/starting_project.rar
Back to top
View user's profile Send private message
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