fork download
  1. #include <string>
  2.  
  3. struct Foo
  4. {
  5. Foo(const std::string&) {}
  6. };
  7.  
  8. int main()
  9. {
  10. Foo f = "Hello";
  11. }
  12.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:10:11: error: conversion from ‘const char [6]’ to non-scalar type ‘Foo’ requested
stdout
Standard output is empty