I have a question for the code here , I am facing an error in this simple code with one struct , if you compile it then the compiler states in the error statement that " expression must be a modifiable lvalue " . What I basically want in this code is to assign for example a name with having an array of struct . So when there gets written x[1].identification = "Id"; , then the compiler gives the error . I am quite stuck in this problem for some time .
Can anybody give a solution to this ?!
Thank you
Here is the code :
#include "stdafx.h"
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<windows.h>
//#include <ctime>
//#include <dos.h>
#include<dos.h>
#include<conio.h>
#include<cstdio>
#define max 20
using namespace std;
struct person
{
char identification[20];
long int code;
char group [20];
int experience;
int age;
};
int main()
{
person x[10];
x[1].identification = "Id"; // this is where the error is being shown
system("cls");
return 0;
}