0
Please what should i use after int main() has been defined in C++
int main() { a=32 b=12 }
32 odpowiedzi
+ 7
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
Y u repeat the same thing again? In the first part ur code has been already done...
+ 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
If U want to creat an app...bt before that u have to learn basics of c++ ....first clear ur basics nd then start.... definitely u can do it..☺️
+ 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
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
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
0
like it's not a must to start with int you can start with main() {
}
0
Please am creating an app where do i start from