Misplaced else in function ...

Discussion in 'C++' started by sashank.thags, Aug 28, 2010.

  1. sashank.thags

    sashank.thags New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    I have a problem with my c++ code which is compiled using turbo c++ on vista

    and the code is:

    outtextxy(99,40,"f");
    p=getch();
    if(p==27)
    main();
    else if(p=='f')

    void fig();

    error is: misplaced else in function

    i have tried changing to
    o uttextxy(99,40,"f");
    p=getch();
    if(p==27){
    main();}
    else if(p=='f') {

    void fig(); }
    and now the error says

    cannot call 'main' from within the program in function

    please help me out
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice