Hello guys i have to do a code with a class of 3 different fields of any data type,(class Person or Building or Car)and 2 constructors(one default and one with the parameters which are spanish huge names)after that program should ask the user the file to open,program opens the file with the name provided in read mode and in a loop till the file ends,and creat the subsequent value of the class and then add those values to a table,printing them using tables then program asks user if he wants to change them or add new object.then output file in write mode
one line per object
#include "stdafx.h"
#include <iostream>
using namespace std;
class person {
char fName , mName, Iname ;
public:
Person();
Person(fName,mName,Iname);
}person ;
The syntax is wrong. You probably need to read a tutorial on C++ Classes to get a feel for what a class is, how to define one and how to use one.
1 2 3 4 5 6 7 8 9 10
class person { // class Personchar fName , mName, Iname ; // string fName, mName, iName;public:
Person();
Person(fName,mName,Iname); // Person(string f, string m, string i);
}person ; // ??? this doesn't belong here, and don't declare variables like this anyway
~person(){ // Bad syntax and unnecessary methoddelete person(fName,mName,iname);
}