C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 9th, 2005, 09:11 PM
Lammy! Lammy! is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 Lammy! User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 11 sec
Reputation Power: 0
c++: ptr to new multidimensional array?

Hey all,
Having a little difficulty, I'm trying to declare a new multidimensional array in c++ given some user input, but it's not coming out for me. What I have so far:

#include <iostream>

using std::cin;
using std::cout;
using std::endl;

int main()
{
int s, n;
int *i;

cout<<"How many numbers: ";
cin>>s;
i = new int[s][20];
system("pause");

}

The problem here is that I can get a one dimensional array, but when I enter the code above, I get a 'cannot convert 'int[*][20] to 'int**' in assignment, so I assume I have my syntax wrong. Anyone able to help? Much appreciated!

Reply With Quote
  #2  
Old February 13th, 2005, 11:52 PM
BoolBooB BoolBooB is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 36 BoolBooB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 35 m 42 sec
Reputation Power: 4

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > c++: ptr to new multidimensional array?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway