samedi 5 octobre 2019

error: conversion from ‘Mstream’ to non-scalar type ‘std::string {aka std::basic_string

Could you please help me to resolve the Error of the below code.

class Mstream{
     unsigned int len;
     char *str;
};

int main(){
   Mstream m1;
   std::string str=m1;// i see error at this statement
}

error: conversion from ‘Mstream’ to non-scalar type ‘std::string {aka std::basic_string}’ requested string str1=m1;

Aucun commentaire:

Enregistrer un commentaire