error C4430 please help ...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bravejuba
    New Member
    • Feb 2012
    • 2

    error C4430 please help ...

    Am a new programmer to the c++ language , i used to program and see the result of my programming in the easy way because i used turbo c++ program , but now i am using microsoft visual studio program to write and build my programs , now i am sort of lost because it's a new whole environment for me , the problem is that i had this program that i wrote and it was working on turbo c++ but now i get this error

    Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


    my program is :

    Code:
    #include "StdAfx.h"
    #include <iostream>
    using namespace std;
    main()
    {
    double  a,b,c;
    char g;
    cout<<"\n\n          _____________________________\n";
    cout<<"\n\n          ((   Currency  Converter   ))\n\n";
    cout<<"          _____________________________";
    choice:
    cout<<"\n\n1-U.S Dollar To Iraqi Dinar  \n2-Iraqi Dinar  To U.S Dollar \n";
    cin>>c;
    if (c==1)
    choice2:
    {
    cout<<"\n\n  _________________________________________________";
    cout<<" \n\n  ((__$ U.S Dollar  To Iraqi Dinar Exchanging $__))";
    cout<<"\n\n __________________________________________________";
    cout<<"\n\n U.s Dollar :";
    cin>>b;
    cout<<" \n It Equals ( "<<b*1200<<" ) In Iraqi Dinar ";
    cout<<"\n\n Choose Again ? Y/N \n ";
    cin>>g;
    if (g==*"y")
    goto choice ;
    else if (g==*"n") goto ending;
    }
    
    else if (c==2)
    choice3:
    {
    cout<<"\n\n  _________________________________________________";
    cout<<" \n\n  ((__$ Iraqi Dinar  To U.S Dollar Exchanging $__))";
    cout<<"\n\n __________________________________________________";
    cout<<"\n\n Iraqi Dinar :";;
    cin>>a;
    cout<<" \n It Equals ( "<<a/1200<<" ) In U.S Dollar ";
    cout<<"\n\n Choose Again ? Y/N \n ";
    cin>>g;
    if (g ==*"y")goto choice;
    if (g ==*"n")goto ending;
    else goto blablabla;
    }
    
    else
    
    {
    cout<<"\n Error ... Please Choose The Correct Choice \n\n ";
    goto  choice ;
    }
    blablabla:
    cout<<"Bla Bla Bla ";
    ending:
    cout<<" \n\n\a *** ^_^ Thanks For Choosing My Modest Programs ^_^ *** ";
    return 0;
    }
    thank you , and sorry for taking some of your precious time , hope that you answer me soon as possible ...

    Greetings
    Ghayth Al-Jomailee
  • coderHead
    New Member
    • Feb 2012
    • 6

    #2
    The main() function should have an int return type, lie this:
    int main()

    Other languages may let you omit the return type and then just assume it to be type int. However, C++ doesn't do that - you must specify the return type for all functions.

    Comment

    • bravejuba
      New Member
      • Feb 2012
      • 2

      #3
      I just did What you said and its the same error :
      Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

      Comment

      • coderHead
        New Member
        • Feb 2012
        • 6

        #4
        Well I simply placed int in front of main() like this:

        int main()

        I was able to compile your program and it ran fine. It said that 5 US dollars are equal to 6000 Iraqi Dinar.

        Make sure you are not capitalizing anything, like Int. Make sure it is lower case.

        Comment

        • whodgson
          Contributor
          • Jan 2007
          • 542

          #5
          It ran OK for me in Dev-C++ (with and without int pre- main())

          Comment

          Working...