hello friends

i am not sure if this is right place to post so sorry in advance if it is not.

i am very interested in learning C++ so i started it with Xcode.
i do not have any previous knowledge of C++. i wrote very first basic program which is as follows

#include <iostream>
using namespace std;

int main()

{
cout<<"Welcome to C++";

return 0;
}

with this code i am having error message about int main() saying it is repeating so i changed it my new code is like as follows

#include <iostream>
using namespace std;

int mainfunction()

{
cout<<"Welcome to C++";

return 0;
}

with this code compile is successful build is successful no error message.
Now real problem is that when i run it, it produce only blank screen, nothing what so ever on it. Please can anyone advise me whats wrong with it why it does not show "Welcome to C++"
Any advise is appreciated
Thanks in advance