Can someone help me fix this code?

Hi, I'm new to coding and I just made this little program but why

Page 1 of 1

5 Replies - 712 Views - Last Post: 10 November 2009 - 05:10 AM Rate Topic: -----

#1 H4CKC0D3R  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 16-September 09

Can someone help me fix this code?

Posted 09 November 2009 - 05:43 PM

Hi, I'm new to coding and I just made this little program but why won't it work?
The error i keep getting is: Unable to start program. The system cannot find the file specified.
Please help me fix this code or problem because its driving me crazy that I can't figure it out.

//Converts $100 to Euros
//Made 11-9-09
#include <iostream>
using namespace std;

#define etod 1.4984

int main ()
{
	double d=100; //$100
	double euro;

euro = etod * d;

cout << euro;
return 0;
}

This post has been edited by H4CKC0D3R: 09 November 2009 - 07:08 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Can someone help me fix this code?

#2 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Can someone help me fix this code?

Posted 09 November 2009 - 06:01 PM

I don't see an issue. I might be able to help if I knew what build errors you got. Of course, you didn't post those errors, so I have to wonder why you would ask a question and then make it so hard for others to help you.

I'd also be motivated to help if I knew what you tried to fix your problem. I mean, it's not like as soon as you got the error, you just ran and dumped the code on the forum. Obviously, you Googled, thought about the problem, and tried various things to fix the error. It would be nice to know what they are.
Was This Post Helpful? 0
  • +
  • -

#3 H4CKC0D3R  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 16-September 09

Re: Can someone help me fix this code?

Posted 09 November 2009 - 07:07 PM

Quote

The error i keep getting is: Unable to start program. The system cannot find the file specified.


Oh and stop asking me what I did to try to find out how to fix the error on my own. This is what I did; I read through some tutorials and when I couldn't find the answer there I made this post on this forum so other people could just help me find the answer.

This post has been edited by H4CKC0D3R: 09 November 2009 - 07:12 PM

Was This Post Helpful? 0
  • +
  • -

#4 H4CKC0D3R  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 16-September 09

Re: Can someone help me fix this code?

Posted 09 November 2009 - 07:18 PM

Nevermind all I needed to add was this:

#include "stdafx.h"

Was This Post Helpful? 0
  • +
  • -

#5 hackterr  Icon User is offline

  • D.I.C Regular

Reputation: 21
  • View blog
  • Posts: 293
  • Joined: 13-August 09

Re: Can someone help me fix this code?

Posted 10 November 2009 - 03:11 AM

if (size_of_signature_pic>size_of_problem)
cout <<"please choose a smaller pic";
else
cout<<"It hurts my eyes";


This post has been edited by hackterr: 10 November 2009 - 03:11 AM

Was This Post Helpful? 0
  • +
  • -

#6 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 855
  • View blog
  • Posts: 2,338
  • Joined: 20-August 07

Re: Can someone help me fix this code?

Posted 10 November 2009 - 05:10 AM

View PostH4CKC0D3R, on 10 Nov, 2009 - 02:18 AM, said:

Nevermind all I needed to add was this:

#include "stdafx.h"

This isn't actually a C++ issue - the original code you posted is perfectly legal and valid, so it would've been impossible for anyone to recreate your problem.

"stdafx.h" isn't a C++ header; its part of a Visual Studio feature called 'Precompiled headers' - something which is enabled by default when you create a Win32 Console Project.
For future reference, you can avoid this problem either by creating a blank or empty project in VS, or by disabling Precompiled headers in your project's properties. I'd recommend doing this, since stdafx.h is wholly unnecessary for anyone just learning the language
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1