?
Solved

Jagged Array in C++

Posted on 2003-11-06
3
Medium Priority
?
1,377 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Make the most of your online learning experience.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

764 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