Fatal Error C010?

Reply

Join Date: Nov 2004
Posts: 3
Reputation: coppernicus is an unknown quantity at this point 
Solved Threads: 0
coppernicus coppernicus is offline Offline
Newbie Poster

Fatal Error C010?

 
0
  #1
Nov 3rd, 2004
Ok Yes I admit it I'm a student with a homework problem but I'm using this forum as a last resort. I've already written the code and I can't find the error no matter how many times I look over it so I really just need a second set of eyes. Don't tell me how to fix it just tell me what line/lines it is in and I'll figure it out myself.

  1. // Weighted Average program
  2. // Written by Will Styers CIS115-01
  3.  
  4. #using <mscorlib.dll>
  5. using namespace System;
  6.  
  7. int main()
  8. {
  9. //declaration of variables
  10. int test1 = 0;
  11. int test2 = 0;
  12. int test3 = 0;
  13. int lab1 = 0;
  14. int lab2 = 0;
  15. int lab3 = 0;
  16. int lab4 = 0;
  17. int lab5 = 0;
  18. int exam = 0;
  19. int avgt = 0;
  20. int avgl = 0;
  21. int finalAverage = 0;
  22.  
  23. //asking for user input
  24.  
  25. Console::Write("Enter first test:");
  26. test1 = Console::ReadLine();
  27. Console::Write("Enter second test:");
  28. test2 = Console::ReadLine();
  29. Console::Write("Enter third test:");
  30. test3 = Console::ReadLine();
  31. Console::Write("Enter first lab:");
  32. lab1 = Console::ReadLine();
  33. Console::Write("Enter second lab:");
  34. lab2 = Console::ReadLine();
  35. Console::Write("Enter third lab:");
  36. lab3 = Console::ReadLine();
  37. Console::Write("Enter fourth lab:");
  38. lab4 = Console::ReadLine();
  39. Console::Write("Enter fifth lab:");
  40. lab5 = Console::ReadLine();
  41. Console::Write("Enter final exam:");
  42. exam = Console::ReadLine();
  43.  
  44. //Equations
  45.  
  46. avgt = (test1 + test2 + test3)/3;
  47. avgl = (lab1 + lab2 + lab3 + lab4 + lab5)/5;
  48. finalAverage = (avgt * .30) + (avgl * .50) + (exam * .20);
  49.  
  50. //output statement
  51.  
  52. Console::WriteLine("The final average is {0}.",Convert::ToString(finalAverage));
  53.  
  54. return 0;
  55. } //End main function
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 220
Reputation: frrossk is an unknown quantity at this point 
Solved Threads: 9
frrossk's Avatar
frrossk frrossk is offline Offline
Posting Whiz in Training

Re: Fatal Error C010?

 
0
  #2
Nov 3rd, 2004
First, I think you should declare avgt, avgl and finalAverage as float or double. But could be useful if you specify what kind of error you get.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 3
Reputation: coppernicus is an unknown quantity at this point 
Solved Threads: 0
coppernicus coppernicus is offline Offline
Newbie Poster

Re: Fatal Error C010?

 
0
  #3
Nov 3rd, 2004
Hmm yeah you're probably right about the data types. I wasn't thinking. Here is the error message I got. I looked it up on Microsoft but to no avail.

fatal error C1010: unexpected end of file while looking for precompiled header directive

I forgot to slip that 1 in there in the thread title.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 220
Reputation: frrossk is an unknown quantity at this point 
Solved Threads: 9
frrossk's Avatar
frrossk frrossk is offline Offline
Posting Whiz in Training

Re: Fatal Error C010?

 
0
  #4
Nov 3rd, 2004
Originally Posted by coppernicus
Hmm yeah you're probably right about the data types. I wasn't thinking. Here is the error message I got. I looked it up on Microsoft but to no avail.

fatal error C1010: unexpected end of file while looking for precompiled header directive

I forgot to slip that 1 in there in the thread title.
Take a look on this: http://www.myserverproject.net/forum/viewtopic.php?t=35. Maybe it will help you.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 3
Reputation: coppernicus is an unknown quantity at this point 
Solved Threads: 0
coppernicus coppernicus is offline Offline
Newbie Poster

Re: Fatal Error C010?

 
0
  #5
Nov 3rd, 2004
Ok I read that thread and gave that a shot now it's not converting the String input in the Console::Readline statements to int. Usually it converts automatically. Will I have to typecast those now?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 220
Reputation: frrossk is an unknown quantity at this point 
Solved Threads: 9
frrossk's Avatar
frrossk frrossk is offline Offline
Posting Whiz in Training

Re: Fatal Error C010?

 
0
  #6
Nov 3rd, 2004
According to MSDN, the Readline method returns a string, so I think you have to do the typecast - lab1 = Convert.ToInt (Console::Readline)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC