473,799 Members | 3,061 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(i nt [], int);
int main()
{
char names [numNames][nameSize]=
{"Collins,Bill" ,
"Smith,Bart ",
"Allen,Jim" ,
"Griffin,Ji m",
"Stamey,Mar ty",
"Rose,Geri" ,
"Taylor,Ter ri",
"Johnson,Ji ll",
"Allison,Je ff",
"Looney,Joe "};

showArray(names ,numNames);

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

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

void selectionSort(c har array[],[nameSize],int size)

in counter, minRow;
char minValue[17];

for(counter = 0; counter < (SIZE - 1); counter++)
minRow = counter;
strcpy =(minValue,arra y[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 2727

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

Similar topics

1
13663
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
10899
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 somehow adding filename and date created in an array, sorting by date and then printing onto an html page with a link to that file. How would I do this though? Is this the simplest method or is there a better way of doin this?
1
3726
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 attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am online. Plz....Plz..Plz...
2
2747
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: bubbleSort(Lstname,j); // Printing array cout << "STUDENT " << setw(8) << "ID " << setw(20)<< "S1 S2 S3 S4" << " S5 S6 S7 S8 AVG"<< endl; cout <<
2
3246
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: error: cannot convert `char (*)' 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...
1
1303
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 before '}' token AND HERE IS MY CODE
1
2528
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); int main() { char names =
1
7192
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 methods or syntax to a less experienced perl coder. I will post links to online resources you can read if necessary. Experienced perl coders might find nothing new or useful contained in this article. Short Review In part one I showed you some...
5
4960
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 there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html Here is some jquery js that I think...
0
9688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4146
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 we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.