I have a
char a[20][20];
char name[30];
when i write: if (a[i][2]=='name') c++ give me the error char can not convert to *char.
My programm read a matrix of char and when it finds variable: name must open a file. Can anyone help me?
Something like that f.open(name);
First, single quotes can only be used to identify one character. Second you need at least one std::string object to use the operator== which is overloaded in a variety of ways for std::string objects. Third, name is the name of an array so putting it between single or double quotes makes no sense. Lastly a[i][2] will always return a reference to a single character. To be honest I don't understand your requirements well at all.
You need strcmp function from the <cstring> library if you want to compare character arrays. If you want to use std::string with getline then you can use the operator== for comparing std::string objects.
A c++ alternative to your 2d array would be std::vector<std::string> theStrings;
Search for getline for info on how to read data from a file stream into a std::string.