Thread: struct access error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    26

    struct access error

    Code:
    #include <curses.h>
    
    int s_palettep;
    int s_usflag;
    int s_cposr;
    int s_cposc;
    
    struct x_mttype   {   struct   {   unsigned int type    : 5;
                                       unsigned int obs     : 1;
                                       unsigned int mystery : 1;
                                       unsigned int locale  : 1;
                                       unsigned int link    : 1;
                                       unsigned int         : 7;
                                   } tile;
                          struct   {
                                       unsigned int tchar   : 8;
                                       unsigned int palette : 5;
                                       unsigned int bright  : 1;
                                       unsigned int         : 2;
                                   } tiledat;
                      };
    
    struct x_mttype s_maptemp[19][79];
    
    void clearmap();
    void edit();
    void ivar();
    
    int main()
    {
      ivar();
      initscr();
      keypad ( stdscr, TRUE );
    
      edit();
    
      endwin();
      return 0;
    }
    That is main.cpp

    Code:
    extern struct x_mttype s_maptemp;
    
    void clearmap()
    {
      for (int a = 0; a < 20; ++a)
      {
        for (int b = 0; b < 80; ++b)
        {
           s_maptemp[a][b].tile.type=0;
        }
      }
    }
    That is clearmap.cpp

    My problem is that I get this error, when I compile and run the program:

    Code:
    9 clearmap.cpp
     no match for `x_mttype &[int]'
    Last edited by sufthingol; 03-22-2005 at 05:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  2. file reading
    By gunghomiller in forum C++ Programming
    Replies: 9
    Last Post: 08-07-2007, 10:55 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  4. using c++ in c code
    By hannibar in forum C Programming
    Replies: 17
    Last Post: 10-28-2005, 09:09 PM
  5. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM