init - 'does not name type' error in small survey app C++ [closed]












-4















Trying to run and compile keeps getting . I've just started learning C++.



Is there something else i need to add to make this program run?



error: 'init' does not name a type





#include <iostream>

using namespace std;

init main()
{
int name;
int number;
int email;
int success = "Your information was successfully submitted"
std::cout << "Please enter your name" << std::endl;
std::cin >> name;
std::cout << "Please enter your Phone number" << std::endl;
std::cin >> number;
std::cout << "And Finally, enter your email address" << std::endl;
std::cin >> email;
std::cout << success << std::endl;
return 0;
}









share|improve this question















closed as off-topic by llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos Nov 24 '18 at 8:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 7





    int main() not init main() :-)

    – TrebuchetMS
    Nov 24 '18 at 6:42













  • You are also missing a ; at the end of line 10.

    – Swordfish
    Nov 24 '18 at 6:58













  • @Swordfish Not to mention that an int can't be properly initialized with a const char* at all.

    – πάντα ῥεῖ
    Nov 24 '18 at 7:49
















-4















Trying to run and compile keeps getting . I've just started learning C++.



Is there something else i need to add to make this program run?



error: 'init' does not name a type





#include <iostream>

using namespace std;

init main()
{
int name;
int number;
int email;
int success = "Your information was successfully submitted"
std::cout << "Please enter your name" << std::endl;
std::cin >> name;
std::cout << "Please enter your Phone number" << std::endl;
std::cin >> number;
std::cout << "And Finally, enter your email address" << std::endl;
std::cin >> email;
std::cout << success << std::endl;
return 0;
}









share|improve this question















closed as off-topic by llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos Nov 24 '18 at 8:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 7





    int main() not init main() :-)

    – TrebuchetMS
    Nov 24 '18 at 6:42













  • You are also missing a ; at the end of line 10.

    – Swordfish
    Nov 24 '18 at 6:58













  • @Swordfish Not to mention that an int can't be properly initialized with a const char* at all.

    – πάντα ῥεῖ
    Nov 24 '18 at 7:49














-4












-4








-4








Trying to run and compile keeps getting . I've just started learning C++.



Is there something else i need to add to make this program run?



error: 'init' does not name a type





#include <iostream>

using namespace std;

init main()
{
int name;
int number;
int email;
int success = "Your information was successfully submitted"
std::cout << "Please enter your name" << std::endl;
std::cin >> name;
std::cout << "Please enter your Phone number" << std::endl;
std::cin >> number;
std::cout << "And Finally, enter your email address" << std::endl;
std::cin >> email;
std::cout << success << std::endl;
return 0;
}









share|improve this question
















Trying to run and compile keeps getting . I've just started learning C++.



Is there something else i need to add to make this program run?



error: 'init' does not name a type





#include <iostream>

using namespace std;

init main()
{
int name;
int number;
int email;
int success = "Your information was successfully submitted"
std::cout << "Please enter your name" << std::endl;
std::cin >> name;
std::cout << "Please enter your Phone number" << std::endl;
std::cin >> number;
std::cout << "And Finally, enter your email address" << std::endl;
std::cin >> email;
std::cout << success << std::endl;
return 0;
}






c++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 '18 at 6:58









Swordfish

9,81011436




9,81011436










asked Nov 24 '18 at 6:42









Beat Emirates - JohnBeat Emirates - John

31




31




closed as off-topic by llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos Nov 24 '18 at 8:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos Nov 24 '18 at 8:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – llllllllll, rsjaffe, πάντα ῥεῖ, eyllanesc, Gábor Bakos

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 7





    int main() not init main() :-)

    – TrebuchetMS
    Nov 24 '18 at 6:42













  • You are also missing a ; at the end of line 10.

    – Swordfish
    Nov 24 '18 at 6:58













  • @Swordfish Not to mention that an int can't be properly initialized with a const char* at all.

    – πάντα ῥεῖ
    Nov 24 '18 at 7:49














  • 7





    int main() not init main() :-)

    – TrebuchetMS
    Nov 24 '18 at 6:42













  • You are also missing a ; at the end of line 10.

    – Swordfish
    Nov 24 '18 at 6:58













  • @Swordfish Not to mention that an int can't be properly initialized with a const char* at all.

    – πάντα ῥεῖ
    Nov 24 '18 at 7:49








7




7





int main() not init main() :-)

– TrebuchetMS
Nov 24 '18 at 6:42







int main() not init main() :-)

– TrebuchetMS
Nov 24 '18 at 6:42















You are also missing a ; at the end of line 10.

– Swordfish
Nov 24 '18 at 6:58







You are also missing a ; at the end of line 10.

– Swordfish
Nov 24 '18 at 6:58















@Swordfish Not to mention that an int can't be properly initialized with a const char* at all.

– πάντα ῥεῖ
Nov 24 '18 at 7:49





@Swordfish Not to mention that an int can't be properly initialized with a const char* at all.

– πάντα ῥεῖ
Nov 24 '18 at 7:49












1 Answer
1






active

oldest

votes


















0














In your code, you have



init main()


this should be



int main()




Since main() is a function (and since this is C++, so it requires a return type), the compiler would check if init is a valid type. It is not. So an error is thrown.




error: 'init' does not name a type




Read more: what should main return in C and C++,






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    In your code, you have



    init main()


    this should be



    int main()




    Since main() is a function (and since this is C++, so it requires a return type), the compiler would check if init is a valid type. It is not. So an error is thrown.




    error: 'init' does not name a type




    Read more: what should main return in C and C++,






    share|improve this answer




























      0














      In your code, you have



      init main()


      this should be



      int main()




      Since main() is a function (and since this is C++, so it requires a return type), the compiler would check if init is a valid type. It is not. So an error is thrown.




      error: 'init' does not name a type




      Read more: what should main return in C and C++,






      share|improve this answer


























        0












        0








        0







        In your code, you have



        init main()


        this should be



        int main()




        Since main() is a function (and since this is C++, so it requires a return type), the compiler would check if init is a valid type. It is not. So an error is thrown.




        error: 'init' does not name a type




        Read more: what should main return in C and C++,






        share|improve this answer













        In your code, you have



        init main()


        this should be



        int main()




        Since main() is a function (and since this is C++, so it requires a return type), the compiler would check if init is a valid type. It is not. So an error is thrown.




        error: 'init' does not name a type




        Read more: what should main return in C and C++,







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 24 '18 at 6:53









        TrebuchetMSTrebuchetMS

        2,73611023




        2,73611023

















            Popular posts from this blog

            Wiesbaden

            Marschland

            Dieringhausen