Please what should i use after int main() has been defined in C++ | SoloLearn: Learn to code for FREE!

-1

Please what should i use after int main() has been defined in C++

int main() { a=32 b=12 }

10/16/2020 11:44:33 PM

Ultra WALKER

33 Answers

New Answer

+6

What do you want to do?

+8

Lmao, it's kinda funny to see you accepted Abhay's answer, and it's actually a question.

+2

Ultra Walker you can't use 'void' as a function name because 'void' is a reserved word. You might want to do the lessons on declaring, defining, and calling functions before trying this.

+1

Ultra WALKER you can't define main function again ,it's the entry point of your app ,any logic to be executed should be written inside the main method ,as far as I understand from the error you are trying to re define the main() which you simply can't as I already said

+1

Ultra WALKER show your code ,copy paste the link of it here,so one can understand what you are trying to do

+1

#include <iostream> using namespace std; int sum(int a,int b) { return a+b; } int main () { cout << sum(30,12); return 0; }

+1

You start by learning C++. That means completing the Course here on SoloLearn then spending some time learning the C/C++ standard libraries. By the way, if by "I want to create a reminder app" you mean an Android app then be advised that Androd apps are tyically written using Java and more recently Kotlin.

+1

Y u repeat the same thing again? In the first part ur code has been already done...

+1

It's better you create a class because you can only define int main() once in C++ code and then use inheritance and polymorphism

+1

using namespace std;

0

I want to practice with it but the compiler keeps saying ERROR RE-DEFINITION OF INT MAIN() INT MAIN() HAS BEEN PREVIOUSLY DEFINED

0

So what do i do if i cant redefine int main() i tried void main() but an error occured and i tried int b()

0

But nothing happened

0

https://code.sololearn.com/cfXf7g5OQeHh/?ref=app

0

Ultra WALKER that works fine ,what were you talking about?

0

read the second part am trying to add on

0

int void() or is it wrong if so what do i type

0

#include <iostream> using namespace std; int main() { int a = 30; int b = 12; int sum = a + b; cout << sum; return 0; }

0

Thats all noting after that

0

Please i want to create a reminder app in C++ how do i start