Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Xcode 3

  • 27-10-2010 5:42pm
    #1
    Closed Accounts Posts: 2,663 ✭✭✭


    since my Windows PC crashed with Dul boot of Linux on it and had Netbean installed on it, i said i'll go away and download Xcode 3 and start using that but when i was doing some Arrays and pointers i was using

    using namespace std;

    void Main () ** this was showing up an Error that i need int main () as my Main ? why is Xcode not working when i have void main ()

    same goes with my Array..

    myArray[3] = {1, 2, 3}
    int mailbox

    myArray[mailbox]
    cout << (int)myArray << mailbox << endl; it wont allow me to use (int) infront of myArray anyone having problems like this with Xcode?


Comments

  • Closed Accounts Posts: 1,155 ✭✭✭Stainless_Steel


    Hi

    I'm not a coder so sorry if this sounds stupid. But doesn't Xcode use Objective C by default? Maybe your code only works with C++?


  • Closed Accounts Posts: 2,663 ✭✭✭Cork24


    Its allows you to code in C & in C++


  • Registered Users, Registered Users 2 Posts: 5,246 ✭✭✭conor.hogan.2


    why dont you use int main()?

    (void is an ms way that is not standard c++ or c = http://www2.research.att.com/~bs/bs_faq2.html#void-main)

    as a general rule if a compiler throws up a warning, follow its advice unless you think you know better but when something goes wrong remember that you were warned.


  • Closed Accounts Posts: 2,663 ✭✭✭Cork24


    just so used to void main()

    that out of the way why is xcode giving error when i have something like

    cout << (int)myArray << Mailbox << endl; ?

    Cast form 'Double*' to 'int' loses precision ? i dont have anything set to double nor have i seen this error code before never got it in netbean only with xcode

    i think i am going to have to go away and buy Vmware and install Ubuntu 10 and install netbean again. dont like the Mac Version of it i dont know why..


  • Registered Users, Registered Users 2 Posts: 5,246 ✭✭✭conor.hogan.2


    I couldn't tell you, I know limited c - I dont know c++.


    But xcode sticks to stricter standards of code than (probably) what you were used to - you were not getting errors before but that does not mean the code was 100% right.

    void main() is not valid c++ - not even valid c so I would heed the errors xcode gives you.


    Loosing accuracy? - depends on the size of the number you're using whether to use int or double.


  • Advertisement
  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    I think you might be more likely to get a better answer to this in the Development forum, so I am moving the thread there.


Advertisement