when i tried to compile it, why i got expected primary-expression before input?
#include "mylibrary.h"
#include "contadd.h" //for function declaration
void Contact::setname(string name)
{
ofstream myfile;
myfile.open(CONTACTS);
if (myfile.is_open());
{
myfile<<name<<endl;
myfile.close();
}
i++;
}
int main(int argc, char* argv[])
{
vector <string> input;
Contact addingname;
if (argc == 2)
{
input.push_back(argv[1]);
cout<<"Ok, contact "<<" "<<i+1<<input.at(0)<<" added "<<endl;
string newname = input[i];
int size = input.size();
for(int j = 0; j<size; j++)
{
if(newname[j] == '@')
{
cout<<"with email address"<<endl;
addingname.setname(string input[j]);//error at here*****
}
if(newname[j] == '@')
{
cout<<"with email address"<<endl;
addingname.setname(string input[j]);//error at here****
}
what is meant by expected primary-expression?