Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

C++ Multidimensional Arrays

By Sripriya R | on September 4, 2007 |
C++ Tutorials

In this C++ tutorial, you will learn about Multidimensional arrays, what is Multidimensional array, how is Multidimensional arrays represented in C++, how to access the elements of a Multidimensional array.

What is a Multidimensional Array?

A Multidimensional array is an array of arrays.

How are Multidimensional Arrays represented in C++

Suppose a programmer wants to represent the two-dimensional array Exforsys as an array with three rows and four columns all having integer elements. This would be represented in C++ as:

int Exforsys[3][4];

It is represented internally as:

Exforsys Data Type: int

How to access the elements in the Multidimensional Array

Exforsys Data Type: int

Based on the above two-dimensional arrays, it is possible to handle multidimensional arrays of any number of rows and columns in C++ programming language. This is all occupied in memory. Better utilization of memory must also be made.

Multidimensional Array Example:

  1.  #include <iostream>
  2. using namespace std;
  3. const int ROW=4;
  4. const int COLUMN =3;
  5. void main()
  6. {
  7. 	int i,j;
  8. 	int Exforsys[ROW][COLUMN];
  9. 	for(i=0;i < ROW;i++)  //goes through the ROW elements
  10. 		for(j=0;j < COLUMN;j++)   //goes through the COLUMN elements
  11. 		{
  12. 			cout << "Enter value of Row " << i+1;
  13. 			cout << ",Column " << j+1 << ":";
  14. 			cin>>Exforsys[i][j];
  15. 		}
  16. 		cout << "nnn";
  17. 		cout << " COLUMNn";
  18. 		cout << " 1 2 3";
  19. 		for(i=0;i < ROW;i++)
  20. 		{
  21. 			cout << "nROW " << i+1;
  22. 			for(j=0;j < COLUMN;j++)
  23. 				cout << Exforsys[i][j]; 
  24. 		}
  25. }
  26.  
  27. }}

At first, it goes through the elements for ROW 1, with all the COLUMNS from 1 to the max value (3), then procedes to the next value of the ROW which is 2, and the COLUMNS from 1 again to the max value. This ends when the ROW reaches the max value of 4, and COLUMNS the max value of 3.

In the above example, the keyword const (specifying constant) precedes the data type that specifies the variable ROW and COLUMN to remain unchanged in value throughout the program. This is used for defining the array Exforsys ROW size and COLUMN size, respectively.

« « Supply Chain Management Skills
C++ Looping » »

Author Description

Avatar

Free Training

RSSSubscribe 401 Followers
  • Popular
  • Recent
  • Object Oriented Programming Paradigm

    June 10, 2006 - 0 Comment
  • C++ Pure Virtual Function and Base Class

    September 28, 2007 - 0 Comment
  • C++ Looping

    September 4, 2007 - 0 Comment
  • C++ Storage Classes

    September 10, 2007 - 0 Comment
  • Elements of Object Oriented Programming

    June 10, 2006 - 0 Comment
  • C++ Friend Functions

    September 28, 2007 - 0 Comment
  • C++ Type Conversions

    August 13, 2006 - 0 Comment
  • C++ Function Passing Types

    September 12, 2007 - 0 Comment
  • Basic concepts of OOPS and Structure of C++ program

    July 26, 2006 - 0 Comment
  • C++ Static Functions

    October 1, 2007 - 0 Comment
  • C++ Dereference Operator

    October 14, 2007 - 0 Comment
  • C++ Memory Management Operators

    October 12, 2007 - 0 Comment
  • C++ Void Pointer and Null Pointer

    October 12, 2007 - 0 Comment
  • C++ Pointers

    October 1, 2007 - 0 Comment
  • C++ Static Functions

    October 1, 2007 - 0 Comment
  • C++ Friend Functions

    September 28, 2007 - 0 Comment
  • C++ Pure Virtual Function and Base Class

    September 28, 2007 - 0 Comment
  • C++ Virtual Functions

    September 25, 2007 - 0 Comment
  • C++ Inline Functions

    September 25, 2007 - 0 Comment
  • C++ Function Passing Types

    September 12, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • C++ Dereference Operator
  • C++ Memory Management Operators
  • C++ Void Pointer and Null Pointer
  • C++ Pointers
  • C++ Static Functions

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2022. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy
Necessary Always Enabled