Solved

2D Arrays

Posted on 1999-01-09
4
147 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

691 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