Solved

2D Arrays

Posted on 1999-01-09
4
145 Views
Last Modified: 2010-04-02
Given the array:      int array [x][y] = {y terms};

How do you you give rows other than the first values?
0
Comment
Question by:Jelo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
ID: 1181794
A 2D array is an 1D array of 1D arrays, so you initialize it using an array of 1D arrays, like

int Array[3][4] = {{1,2,3}, {4,5,6},{7,8,9}.{10,11,12}};
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1181795
just a small correction which is a typo...

}.{

should be
},{
0
 
LVL 22

Expert Comment

by:nietod
ID: 1181796
You must have better eyes and/or a better font than me.  Thanks.  
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1181797
no problem
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question