How to fix error "expected unqualified-id at end of input"?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wiki
    New Member
    • Apr 2014
    • 1

    How to fix error "expected unqualified-id at end of input"?

    Code:
    #include<iostream.h>
    #include<stdio.h>
    #include<conio.h>
    using namespace std;
    class CV
    {
    	public:
    	char name; 
    	char qualfctn;
    	int idno;
    	int age;
    	char city;
    	char hobbies;
    	char skills;
    
    	
    	void getdata()	
    {
    	cout<<"Enter name, qualfctn, id-no, age, city, hobbies & skills respectively :  ";
    	cin>>name, qualfctn, idno, age, city, hobbies, skills;	
    }
    
    
        void showdata ()
    	{
    		cout<<"your name is :  "<<name<<endl;
    		cout<<"your qualfctn is :  "<<qualfctn<<endl;
    		cout<<"your idno is :  "<<idno<<endl;
    		cout<<"your age is :  "<<age<<endl;
    		cout<<"your city is :  "<<city<<endl;
    		cout<<"your hobbies is :  "<<hobbies<<endl;
    		cout<<"your skills is :  "<<skills<<endl;
    	};   
    	
    	
         void main ()
         {
         	CV name;
         	
         	name.getdata();
         	name.showdata();
         	
         	CV qualfctn;
         	
         	qualfctn.getdata();
         	qualfctn.showdata();
         	
         	CV idno;
         	
         	idno.getdata();
         	idno.showdata();
         	
         	CV age;
         	
         	age.getdata();
         	age.showdata();
         	
         	CV city;
         	
         	city.getdata();
         	city.showdata();
         	
         	CV hobbies;
         	
         	hobbies.getdata();
         	hobbies.showdata();
         	
         	CV skills;
         	
         	skills.getdata();
         	skills.showdata();
         	getch ();
    } 
    }
    Last edited by Rabbit; Apr 4 '14, 05:32 AM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    It looks like you are missing the closing brace on your class declaration. I see a semi-colon at the end of the showdata function but it is appearing after the closing brace of the function leading me to think this brace was mistaken to be the closing brace of the class.

    My compiler is out of service for the moment due to a machine crash so I can't compile your code.

    Comment

    Working...