Thank you for any advice.
#include <iostream>
#include <string>
#include <limits> //for numeric validation of separate part of code
#include <cctype>
using namespace std;
int main()
{
string *name; // pointer to name array
int *votes, // pointer to vote array
i,
numVotes;
votes = new int[numVotes]; // Dynamicly allocate votes
name = new string[numVotes]; // Dynamicly allocate names
for(i=0;i < numVotes; i++){
cout<<"\nEnter last names: ";
getline(cin,name[i]);
/***************************************************************************/
while (name[i])
{
if (isalpha(name[i])) cout << "character " << name[i] << " is alphabetic\n"; // <-- error C2664: 'isalpha' : cannot //convert parameter 1 from 'std::string' to 'int'
//else cout << "character " << name[i] <<" is not alphabetic\n";
i++;
}
/***************************************************************************/
}//end for for loop

New Topic/Question
Reply




MultiQuote




|