473,513 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Sorting an array of supplied names

15 New Member
I need to display the unsorted list of names and display the sorted list of names.

My program is getting a bunch of errors though, and i dont know why.

I am getting the following errors.

28: error: cannot convert `char (*)[17]' to `int*' for argument `1' to `void showArray(int*, int)'
33: error: expected unqualified-id before "for"
33: error: expected constructor, destructor, or type conversion before '<' token
33: error: expected constructor, destructor, or type conversion before '++' token
38: error: expected identifier before '[' token
40: error: expected initializer before "in"
43: error: expected unqualified-id before "for"
43: error: expected constructor, destructor, or type conversion before '<' token
43: error: expected constructor, destructor, or type conversion before '++' token
45: error: expected constructor, destructor, or type conversion before '=' token
47: error: expected constructor, destructor, or type conversion before '<' token
47: error: expected constructor, destructor, or type conversion before '++' token
52: error: expected declaration before '}' token


Here is my code. Any help is appreciated.


#include <iostream>
using namespace std;

const int numNames = 10;
const int nameSize = 17;
void showArray(int [],char);
void selectionSort(int [], int);
int main()
{
char names [numNames][nameSize]=
{"Collins,Bill",
"Smith,Bart",
"Allen,Jim",
"Griffin,Jim",
"Stamey,Marty",
"Rose,Geri",
"Taylor,Terri",
"Johnson,Jill",
"Allison,Jeff",
"Looney,Joe"};

showArray(names,numNames);

}
void showArray(char array[], int SIZE);

for(int counter = 0; counter < size; counter++)
{
cout << array[count] << endl;
}

void selectionSort(char array[],[nameSize],int size)

in counter, minRow;
char minValue[17];

for(counter = 0; counter < (SIZE - 1); counter++)
minRow = counter;
strcpy =(minValue,array[counter]

for(int index = counter+1; index < SIZE; index++)
{ if(strcmp(array[index],minValue)<0)
strcpy(minValue,array[index]);
minRow = index;
}
}
Nov 9 '06 #1
0 2713

Sign in to post your reply or Sign up for a free account.

Similar topics

1
13616
by: Brian | last post by:
I have an array like this: $events = array( array( '2003-07-01', 'Event Title 1', '1' //ID Number (not unique) ), array( '2003-07-02',
6
10879
by: bissatch | last post by:
Hi, I am about to write an application that will display all pdf files in a folder and display them by file name in order of date. Is there an easy way of doing this? I was thinking about...
1
3694
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
2
2729
by: zfareed | last post by:
I managed to sort a 2-dim array of lastnames but I am having trouble with printing the corresponding first names which are stored in a different 2-dim array. Here is my code for: ...
2
3235
by: k1ckthem1dget | last post by:
I need to display the unsorted list of names and display the sorted list of names. My program is getting a bunch of errors though, and i dont know why. I am getting the following errors. 28:...
1
1292
by: k1ckthem1dget | last post by:
I am trying to write a program which sorts an array of supplied names. Here are the errors i am getting. 33: error: expected unqualified-id before "for" 37: error: expected declaration...
1
2507
by: k1ckthem1dget | last post by:
I am trying to write a program which sorts an array of supplied names. These are the errors i am getting. .cpp:39: error: expected identifier before ',char); void selectionSort(int , int);...
1
7166
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
5
4903
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
7257
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
7157
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
7535
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
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.