Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

2D Arrays

Posted on 1999-01-09
4
Medium Priority
?
154 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

618 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