|
-
Oct 8th, 2006, 09:14 AM
#1
Thread Starter
Frenzied Member
Simple help
there are a few layout problems eg. numbers are
stuck to
names and they are numbered from 0 to 9 rather than 1 to 10
#include <iostream>
#include <string>
using namespace std;
// Function prototype
void showStudentNames(string *,string *);
// Define the constant
const int NUM_STUDENTS = 11;
int main()
{
string firstnames[] = {"Rudolf","David","Supong","Morrakot","Marsan","Laksmana","Todd","Steven","Dianne","Nittaya"};
string lastnames[] = {"Jones","Rhodes","Mangunwijaya","Jiengpattanakit","Khoangam","Sankey","Gowans","Veldman","Straughan ","Djuniarti"};
showStudentNames(firstnames,lastnames);
getchar();
return 0;
}
void showStudentNames(string *first,string *last)
{
for(int i=0;i<NUM_STUDENTS;i++)
cout<<i<<' '<<last[i]<<", "<<first[i]<<endl;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|