Search the web
Sign In
New User? Sign Up
c-prog · C/C++ Programmer's Mailing List
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
need help   Message List  
Reply | Forward Message #68771 of 71515 |
Re: need help

I seldom use the old-fashioned C-type arrays or pointers to them,
but vectors instead, a container STL class.

#include <iostream>
#include <iomanip>
#include <vector>

using namespace std;

int main() {
vector <vector<int> > v;

for (int i=0; i<10; i++) {
v.push_back(vector <int>());
for (int j=0; j<10; j++)
v.at(i).push_back(i+j);
}

for (vector <vector<int> >::iterator i=v.begin(); i<v.end(); i++) {
for (vector<int>::iterator j=(*i).begin(); j<(*i).end(); j++)
cout << setw(3) << *j;
cout << endl;
}

cin.get();

}

Best,

Geraldo


--- In c-prog@yahoogroups.com, "s_zhbjvd" <s_zhbjvd@...> wrote:
>
> Hello how are you all I just want to know that how can we use
pointers
> on a two dimensional array please explain !!!!!!!!
>





Tue Nov 18, 2008 4:17 pm

py2akv
Offline Offline
Send Email Send Email

Forward
Message #68771 of 71515 |
Expand Messages Author Sort by Date

Hello how are you all I just want to know that how can we use pointers on a two dimensional array please explain !!!!!!!!...
s_zhbjvd
Offline Send Email
Nov 18, 2008
12:36 pm

I seldom use the old-fashioned C-type arrays or pointers to them, but vectors instead, a container STL class. #include <iostream> #include <iomanip> #include...
py2akv
Offline Send Email
Nov 18, 2008
4:17 pm

Hi,       you can assign two dimension  array to pointer like this int array[10][10]; int (*ptr)[10] // ptr is pointer to an array of ten int(i,e ptr is...
Rajath N R
rajath_nr
Offline Send Email
Nov 19, 2008
12:22 pm

... Can you be more specific? You can find general information here: http://www.google.com/search?q=pointer+%22two+dimensional+array%22+c David...
David Hamill
dc_hamill
Offline Send Email
Nov 18, 2008
1:54 pm

... From: "David Hamill" <david@...> To: <c-prog@yahoogroups.com> Sent: Tuesday, November 18, 2008 8:53 AM Subject: Re: [c-prog] need help ... What...
Bill Cunningham
billcu34
Offline Send Email
Nov 18, 2008
2:08 pm
 First  |  |  Next > Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help