Thread: size of 2D array

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    FYI, this "program" won't compile, and isn't valid C++. A function cannot be declared to take a 2d array of unspecified width, and == must not have a space between it.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  2. #2
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Quote Originally Posted by King Mir View Post
    FYI, this "program" won't compile, and isn't valid C++. A function cannot be declared to take a 2d array of unspecified width, and == must not have a space between it.
    This also points out that you cannot use an array[][] in general as you cannot specify the size since you need it flexible as you are passing its size as well. You can use int** instead.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. size of an array poited by array element
    By mitofik in forum C Programming
    Replies: 7
    Last Post: 12-24-2010, 12:09 AM
  2. How do I get the size of an array from a pointer to the array?
    By Programmer_P in forum C++ Programming
    Replies: 31
    Last Post: 06-03-2010, 04:13 PM
  3. size of array - why function gives size ONE only
    By noob123 in forum C++ Programming
    Replies: 7
    Last Post: 12-18-2009, 05:20 PM
  4. Finding Words in a array[size][size]
    By ^DJ_Link^ in forum C Programming
    Replies: 8
    Last Post: 03-08-2006, 03:51 PM
  5. array size??
    By CCCP in forum C Programming
    Replies: 2
    Last Post: 01-10-2002, 10:27 AM

Tags for this Thread