#include<stdio.h>
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
class base {
public:
int lookup(char c);
}; // class base
int base::lookup(char c)
{
cout << c << endl;
} // base::lookup
int main() {
base b;
char c = "i";
b.lookup(c);
} // main
在编译上面的代码时,我得到以下错误:
g ++ -c test.cpp test.cpp:在函数'int main()'中:test.cpp:20:10:错误:从'const char *'到'char'的无效转换[-fpermissive]