#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]