Tushar
Case
klimi
Tushar
桃桃乌龙
I thought buffers and pointers are not exact the same thing in C, but in machine language it really is, they’re just offsets
klimi
Tushar
Tushar
Correcting
Tushar
It
klimi
Wtf is e1.e2.dob2[]
klimi
You need to put index in that
klimi
[] is invalid syntqx
Tushar
klimi
Where do you define e1?
klimi
You need to have in main something like name e1;
klimi
I don't know much I can't do C at all and I am not programmer
DaVlad 🇸🇰
char str[] = "Your string";
Jussi
how about actually using strcpy instead of trying to change the pointer itself?
Tushar
Jussi
Now you are trying to assign the POINTER different value, and not copying the string. You cannot copy strings with = in C
Tushar
This is correct.. the mistake is the line 9 only
Jussi
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
Tushar
Jussi
if you pay me $40 per hour I will do it
Tushar
桃桃乌龙
So something like str1 = str2 is just making str1 points to str2
Jussi
It's not a joke though lol
Jussi
Jussi
and if str2 gets freed, trying to print str1 will segfault
桃桃乌龙
You’re not changing the actualy string content, it’s still there, where str1 was pointing at
Jussi
that is also correct
Tushar
Tushar
Dima
/warn read the rules please
Tushar
/warn
Tushar
Rules plz
Jussi
#rules
Tushar
Jussi
What I did wrong... miss
maybe this?
"* Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed."
Tushar
Ohk... sorry for my mistake...
桃桃乌龙
桃桃乌龙
The content isn’t erased by calling free() though
桃桃乌龙
Jussi
mmmh
Jussi
and you can find errors like that by using valgrind/memory sanitizer
桃桃乌龙
yeah it’s called use-after-free
桃桃乌龙
might be a security flaw irl
桃桃乌龙
C is dangerous if you don’t know what you’re doing
Anonymous
What is github
Anonymous
Hello anyone tell me
Anonymous
桃桃乌龙
How it works
http://lmgtfy.com/?iie=1&q=how%20github%20works
Anonymous
I'm asking,how can i control my software version using this web based hosting services
桃桃乌龙
you control your software version by using git, it’s not neccessary to use github. basically github hosts git repo for you, but you could do without that. search for tutorials on git.
H̲i̲L̲e̲v̲e̲l̲
Oh there is russian with brain
Anonymous
桃桃乌龙
Are you joking or just trying to be offensive
Francisco
Dima
Lol.
DaVlad 🇸🇰
Anonymous
Google searching techniques
Dima
Where these people come out from 😂
桃桃乌龙
I don’t know why ppl say it’s unpredictable… it is actually predictable, it’s not ramdom, with a debugger you could really predict that though no one would waste their time on it.
Nikolas
Anonymous
Francisco
桃桃乌龙
yeah just don’t do it anyway
Jussi
Some OS kernels might actually null the freed memory
Jussi
So it is UB
H̲i̲L̲e̲v̲e̲l̲
H̲i̲L̲e̲v̲e̲l̲
It's not often
Nikolas
that's quite racist 🤔