sorting using "strcmp" command

Hi everyone, i'm new to C++ and i want to sort name alphabetically and i came up with this program but i'm having error. find my program below; can someone go through it and tell me what i'm missing.
------------------------------------------------------------------------------
/ test program cpp : Defines the entry point for the console application.
// This program will display 3 names in alphabetical order
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int main()
{
int name1, name2;

char temp, SIZE;




cout << "Enter a name: ";
cin>> str(name1);

for (name1 = 0; name1 < 3 ; name1++)
{

for (name2 = name1; name1 < name2; name2++)

{

if (strcmp(str[name1], str[name2]) > 0)
{
strcpy(temp, str[name1]);
strcpy(str[name1], str[name2]);
strcpy(str[name2], temp);
}


}
// Display sorted name

} cout << "\n sorted names are : \n\n";

for (name1=0; name1<3; name1++)
{
cout << str(name1) << "\n\n";

}


return 0;
I see a couple problems...one being you never there is no defined symbol "str". Please be more specific about the problem (i.e. what errors you are getting) and use [code][/code] tags.
i'm two errors, you are right about "str" identifier, the error is coming up as: error c3861: 'str' identifier no found and error c2664: 'strcmp' cannot convert parameter 1 from 'char' to 'char'.
Topic archived. No new replies allowed.