?
Solved

Jagged Array in C++

Posted on 2003-11-06
3
Medium Priority
?
1,395 Views
Last Modified: 2012-06-22
Create a jagged array named foo in C++.  Row 0 will contain the integers 1,2; row 1 will contain 4,3,3,0; and row 2 will contain 5,6.
0
Comment
Question by:Xirom431
[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
3 Comments
 
LVL 11

Expert Comment

by:bcladd
ID: 9696560
This sounds a lot like homework. It is agains EE policy for members to do homework OR for members to request solutions to homework. Has something to do the "academic honesty".

That said, what do you know how to do in C++? Show us your code so far and we would be happy to answer your specific questions.

-bcl
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 9696715
Agree.  Who is your instructor?  Foo was the favorite example variable of an teaching buddy of mine.

mlmcc
0
 
LVL 5

Accepted Solution

by:
waelothman earned 400 total points
ID: 9698857
if i understand write you want 2 dim. array without fixing the dimention
contain 3 rows the 1st row contain 4 elements and the second contain 4 elements and the 3ed conatin 2 elements
this can be done by creating array of pointer as

int *  foo[3];
foo[0] = new int[2];
foo[0][0]=1;foo[0][1]=2;
foo[1] = new int[4];
foo[1][0]=4;foo[1][1]=4;foo[1][2]=4;foo[1][3]=0;
foo[2] = new int[2];
foo[2][0]=5;foo[2][1]=6;

but i want to add if this is homework try to know why we think like that the solution itself not the problem ,but the problem always in the way of thinking
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

650 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