What is wrong in below code? this code resulted in illegal memory access and the program is terminated by os. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is wrong in below code? this code resulted in illegal memory access and the program is terminated by os.

tuple <string,string,string> t1; t1=make_tuple("a1","b1","c1"); string tag="a1",a,b,c; tie(a,b,c)=t1; if(a==tag){ return a; } //Above code is a member function //"tag" is the member variable of object

24th Apr 2021, 3:17 PM
𝖆𝖙.𝖚𝕷
𝖆𝖙.𝖚𝕷 - avatar
1 Answer
+ 1
got it, access the member variable "tag" with "this->tag"; if(a==this->tag){ return a; }
24th Apr 2021, 3:40 PM
𝖆𝖙.𝖚𝕷
𝖆𝖙.𝖚𝕷 - avatar