MaCRo problem

This is a discussion on MaCRo problem within the C++ Programming forums, part of the General Programming Boards category; What am i doing wrong here? the commented out code causes the following errors. error C2143: syntax error : missing ...

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    11

    MaCRo problem

    What am i doing wrong here? the commented out code causes the following errors.

    error C2143: syntax error : missing ')' before ';'
    error C2143: syntax error : missing ']' before ')'
    error C2143: syntax error : missing ';' before ')'
    error C2059: syntax error : ')'
    error C2059: syntax error : ']'
    error C2143: syntax error : missing ')' before ';'
    error C2059: syntax error : ']'


    Code:
    #include<iostream>
    #define SIZE 2;
    using namespace std;
    
    int ray[2][2];
    //int ray[SIZE][SIZE];
    int main() {
    }

    Thanx

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    You are putting a semi colon in your #define.

    Since you are using C++, consider using a const.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    This macro replaces each occurrence of the token SIZE with 2;, resulting in

    Code:
    int ray[2;][2;];
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem in macro
    By Bargi in forum C Programming
    Replies: 17
    Last Post: 02-04-2009, 10:17 AM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 09:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21