fork download
  1. #include <string>
  2.  
  3. struct wordType {
  4. std::string word_ = "";
  5. int count_ = 0;
  6.  
  7. wordType() = default; // allow `wordType object;`
  8. wordType(const std::string& word) : word_(word) {}
  9. wordType(const std::string& word, int count) : word_(word), count_(count) {}
  10. };
  11.  
  12. int main() {
  13. wordType object("hello world");
  14. }
  15.  
  16.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty