Комментарии:
&
Ответить&
ОтветитьYou scanf() without checking its return value, you're headed for UB land anyway. ;-)
ОтветитьImagine forgetting to use reference instead of value in scanf. Good ol' C.
ОтветитьScanf expects a pointer
ОтветитьThe moment i saw that he declared x as an value and not an pionter i knew his hdd gimma be dead 🗿
ОтветитьAs one man once said,
"I fear nothing. But when I hear 'C' and 'strings' in one sentence, it scares me."
you need to use the adress for x in scanf, not just x itself
scanf("%d", &x);
uses scanf very obviously wrong
_PERFECT_
you need to pass a address of the x to the scanf
ОтветитьAlways happens to me forgetting the & in scanf
ОтветитьShit was doomed from the start when he didn't malloc or at least declare a buffer
ОтветитьImagine not compiling with -Werror
ОтветитьThat pointer cost him his life..rip
Ответитьreal C devs know there IS NO USER INPUT BECAUSE THERE IS NEVER A USER HEHEHEHEHEHHEEHEH
ОтветитьTeachers be like “Now do it without help or by yourself”
Ответитьas an python programmer, you are programming in C hinese
Ответить🤓
ОтветитьI saw it instantly bro... NOOOOOOOOOOOOOOOOOOOOOO
Ответитьscanf("%d", &x)
ОтветитьPlease put whatever link you want after the content is fully finished. It's annoying to have something happen in the video and the giant hyperlink block everything even if it's not that important. My bad if i sound annoyed.
Ответитьkind gcc has gave you a warning msg 😂😂
ОтветитьMPFR FTW.
ОтветитьJust turn on "-Wall -Wextra -Werror" to stop shit like this
ОтветитьMeanwhile in python:
x=int(input())
print(x)
Like that's it 2 lines and done
THAT SCANF!!!!!!!!
Ответить&
Ответить&
ОтветитьThis is why you compile with "gcc -Wall -Werror -Wextra -pedantic"
ОтветитьI am learning c++ and have zero clue what an "argc" and an "argv" are, as well as "scanf();" and "printf();".
ОтветитьThis is so meme
Ответить"If you code segfaults we will erase your hard drive"
I N T E R E S T I N G
I think I saw this one in pwnable ngl
Ответитьscanf("%d", &x); what you did was give scanf an uninitialized variable.
ОтветитьI guess that it would work (on most platforms) if you initialized x to the address of itself before scanf 😄
x = (int) &x;
bro &x;
ОтветитьReminder to ppl reading this comment:
A segfault is when a process tries to write into the memory of another process
Scanf just dumps stdin into a memory address
scanf(“%d”,x); does NOT write stdin int into x, but it writes stdin int to whatever address x of memory
scanf(“%d”,&x); writes stdin int into wherever in memory int x is because &x is where x is in memory
hey guys
currently trying this on windows 11.
Any idea how I can deactivate the fault tolerant heap for only one code execution?
Maybe there is some c lib to deactivate and reactivate it?
u forget the & before x in scanf function
Ответитьholy fuck, I feel sick seeing that x being passed as value to scanf
ОтветитьIn the Bible (K & R), it specifically warns that scanf needs to be passed a pointer, AND also makes the point that this is a common fault.
ОтветитьYou wrote the code wrong
scanf takes the address of x, not x, so use &x and not x.
why he puts these argv argc bs?
ОтветитьJust started learning Go last week after only ever using interpreted languages before (I heard Go was easy compared to other compiled languages). While I have no real experience in C (other than trying and failing years ago) I'm pleasantly surprised that I actually knew where the error was (passed a value instead of a pointer in the scan function). Maybe there is hope for me yet and I could eventually learn C. And Go could be the gateway to learning it.
Ответить&😂😂
ОтветитьI would called this skill issue
Ответить&
Ответить