Can anyone explain me pointers to 2D array ?? I have to input array of string using and read them in another function but I am having a REALLY TOUGH time with pointersan anyone explin it to me or refer good guide to pointers ?? I am using borlnd c++ 3.0v.
atish00
0
Junior Poster
Recommended Answers
Jump to PostC++?
2D arrays of char?What about a reference to a std::vector of std::string ?
Easy, and safe!
Jump to PostI think you need to be more concise with the requirements.
You have 30 strings correct? Does this mean that they each cannot be more than 20 characters long (including the null terminator)?
You must make your char[20][30] (or most likely char[30][20]) in pointer form, then convert it …
Jump to PostFirst of all, if you want 30 strings of up to 20 characters each, then your declaration should be the other way around, and you need an extra char for each null terminator (the character that ends a string):
char axx0[30][21]; // 30 strings of up to …
All 10 Replies
Salem
5,138
Posting Sage
atish00
0
Junior Poster
atish00
0
Junior Poster
Alex Edwards
321
Posting Shark
mahlerfive
23
Junior Poster in Training
Salem
5,138
Posting Sage
atish00
0
Junior Poster
atish00
0
Junior Poster
fishky
0
Newbie Poster
Salem
5,138
Posting Sage
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.