Results 1 to 3 of 3

Thread: error c2440

  1. #1
    Join Date
    Aug 2007
    Posts
    90

    error c2440

    hello,
    when i try to compile a piece of code given in the 3dbuzz video's, i get an odd error message, saying that "it can't convert int to int [3]."
    i've already changed int into array, but that gave a bunch more errors.
    here is the code.


    #include <iostream>


    using namespace std;

    int main()
    {
    int MyArray[3] = (1, 2, 3);

    cout << (int)MyArray[1] << endl;

    return 0;
    }

    i know the video's are a bit old, but they used to work fine

    regards,
    phoenix

  2. #2
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    Quote Originally Posted by phoenix2000 View Post
    int MyArray[3] = (1, 2, 3);
    this line is bogus, you probably meant
    Code:
    int MyArray[3] = {1, 2, 3};
    the curly braces are somewhat hard to spot in the videos.

  3. #3
    Join Date
    Aug 2007
    Posts
    90
    that's it, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •