Dear Friends,
I am getting the following error when I integrate this piece of code into my program , but when I execute this independently It is executing fine so what could be the reason.
Error : error: expected unqualified-id before numeric constant
error: no match for ‘operator==’ in ‘fname == 65’
note: candidates are:
/usr/lib/gcc/i686-redhat-linux/4.6.3/../../../../include/c++/4.6.3/array:200:5: note: template<class _Tp, unsigned int _Nm> bool std::operator==(const std::array<_Tp, _Nm>&, const std::array<_Tp
Till now I have not understood where is your code and what peace of code did you integrate.
But in any case the error refers to standard class std::array. I do not know why it refers to this class because you are uncapable to show clear where is your code and what piece of code did you integrate.
Dear friend ,
See the bellow code in that only you will understood in way I will explain ok. This code is the part of one switch case in my program , so this case code only giving the above error .
[code]
From here to
const string IFNAME = "wlan0"; -- --- Error is here "error: expected unqualified-id before numeric constant"
ifstream input("/proc/net/wireless");
if(!input)
{
cout << "Couldn't open the file\n ";
return 1;
}
string line;
while(getline(input, line)) {
istringstream bp(line);
string fname;
bp >> fname;
if(fname == IFNAME + ':') -----> Error :: error: no match for ‘operator==’ in ‘fname == 65’
{
replace(line.begin(), line.end(), '.', ' ');
cout << "Interface Name: " << fname << '\n';
same code what I posted earlier only ok. Please see bellow one , after getting the position of status in /proc/wireless file , converting status into integer and then pushing into vector of structure name sr( status_response) . Similar to all parameter in wireless.h file like LEVEL and all I'm pushing .
i = atoi(word.c_str());
sr.rsp.states_rsp_list.push_back(i);
states_rsp_list.push_back(i);
You declared IFNAME as string but somewhere in the code (maybe in some header) this name was declared some other way. Try to search every occurence of this name in used modules and headers.