473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

What will it do?

Let i have a 2d character array.
=====================
char array[5][25];
array[2]="\0";
for (int i=0; i<5; i++)
{
cout<<"Enter the value ";
cin>>array[i];
}
for (int j=0; j<5; j++)
{
cout<<array[j]<<endl;
}


=======================
will it get input in array[2] ?

i have done this but it gave me error to debug....
please help;

and how can i sort more than one 2D arrays??
i tried but it sort only one array but it also gave me error to
debug...


Please help ..........

REGRADS:
Xohaib
Dec 3 '07 #1
2 1412
On Dec 3, 9:44 am, Xohaib <zohaib.shir...@gmail.comwrote:
Let i have a 2d character array.

=====================
char array[5][25];
array[2]="\0";
for (int i=0; i<5; i++)
{
cout<<"Enter the value ";
cin>>array[i];}

for (int j=0; j<5; j++)
{
cout<<array[j]<<endl;

}

=======================
will it get input in array[2] ?

i have done this but it gave me error to debug....

please help;

and how can i sort more than one 2D arrays??

i tried but it sort only one array but it also gave me error to
debug...

Please help ..........

REGRADS:
Xohaib
What are you trying to do doesn't make any sense.

What does it mean "to sort more than one 2D arrays" ?
Dec 3 '07 #2
Xohaib wrote:
Let i have a 2d character array.
=====================
char array[5][25];
Better use a vector of strings instead of an array of arrays of raw
characters.
array[2]="\0";
The above line should not compile. You can't assign to arrays.
for (int i=0; i<5; i++)
{
cout<<"Enter the value ";
cin>>array[i];
What happens if the user enters more than 24 characters?
}
for (int j=0; j<5; j++)
{
cout<<array[j]<<endl;
}


=======================
will it get input in array[2] ?
That depends. If the stream goes into error state, you won't get a valid C
style string for all following elements.
and how can i sort more than one 2D arrays??
Not sure what you mean by that.
i tried but it sort only one array but it also gave me error to
debug...
How did you try? What was the error? Where did you get it?

Dec 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: David MacQuigg | last post by:
I'm concerned that with all the focus on obj$func binding, &closures, and other not-so-pretty details of Prothon, that we are missing what is really good - the simplification of classes. There are...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
3
by: mark | r | last post by:
is there an industry standard method of costing out a project the problem i have is that when talking to a developer they say "i dont know how long it will take" which just isnt acceptable #...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.