Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 16th, 2006, 3:09 AM   #1
veiga2
Newbie
 
veiga2's Avatar
 
Join Date: May 2006
Location: Philippines
Posts: 21
Rep Power: 0 veiga2 is an unknown quantity at this point
multi dimensional array error

i hav a problem bout arrays... why cant i allocate the variable in this array?
thnx for your help

#include<iostream>
using namespace std;


main()
{
int r=1,c=1,r2,c2;

cout<<"Enter the no. of rows you desire for matrix1:";
cin>>r;
cout<<"Enter the no. of coloumns you desire for matrix1:";
cin>>c;
cout<<"Enter the no. of rows you desire for matrix2:";
cin>>r2;
cout<<"Enter the no. of coloumns you desire for matrix2:";
cin>>c2;

if(r2>c)
cerr<<"invalid row input";


int **matri1[]=new int[r][c];// source of error<----- this is it





for(int i=0;i<r;i++)
{

for(int j=0;j<c;j++)
cin>>matri1[i][j];
}

for(int k=0;k<r;k++)
{
for(int j=0;j<c;j++)
{
cout<<matri1[k][j];
}
cout<<endl;
}







}
veiga2 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# corruption!!! Kilo C++ 32 May 21st, 2006 9:44 PM
Masm rsnd Assembly 4 May 20th, 2006 10:05 PM
libraries matko C 1 Jan 22nd, 2006 3:12 PM
HELP please!!! hamacacolgante C 7 Nov 21st, 2005 6:36 AM
Installing IPB 2.03 bh4575 Other Web Development Languages 0 Apr 23rd, 2005 3:36 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC