Message from C, C++ talks

June 2019

— I don't know much I can't do C at all and I am not programmer

— Char str[] = "Your string";

— How about actually using strcpy instead of trying to change the pointer itself?

— Are u really trying on compiler or not


Now you are trying to assign the POINTER different value, and not copying the string. You cannot copy strings with = in C

— This is correct.. the mistake is the line 9 only

— You should really learn the basics

— There’s no built-in string type in C while other languages like Java and Python do, char* is literally a pointer to char

Message permanent page

— Please teach me then...

— If you pay me $40 per hour I will do it

— Hahaha.... very funny

— So something like str1 = str2 is just making str1 points to str2

— It's not a joke though lol

— Yes

— And if str2 gets freed, trying to print str1 will segfault