Thread: Arrays of references

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Let's do some coding! Welshy's Avatar
    Join Date
    Mar 2005
    Location
    Staffordshire University, UK
    Posts
    168

    Arrays of references

    Still making this minesweeper clone, hehe. Anyway, i cant make an array of references apparantly, i googled it and came out with this:
    Operators are not applied to references but to the variable of which it is a synonym. For instance, we cannot know the address of a reference, only of its synonym; we cannot define a pointer to a reference, it would point to its synonym; we cannot define an array of references, it is an array of the synonyms; etc.
    ...of which i have no idea what it's talking about, lol. Now this is refering to my minefield, which i wanted to create as a 9x9 2d array, but when i pass it to my random mine placing function im a little stuck. A friend just suggested using a pointer, but surely that would generate basically the same error? Is there any way that i could do this? other than using a global variable
    Last edited by Welshy; 07-02-2005 at 11:22 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  4. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM