#2d array in c language
1 messages · Page 1 of 1 (latest)
Those for loops look sussy
i had to trace the program 4 times
so i can understand
They're doing nothing
💀
They're probably ignored by the compiler
simply theyre swaping aroun the diagonal
NO
Man
J is initialized into the for loop scope
It isn't used inside it
It just doesn't do anything
Oh no
You right
Lmao
What is hard to understand for u?
but still works as a one
i dont get the j<i
Anyway , they're idiot
who
hm can u write it down wdym
I have no time now
rows and columns
Just reason
I have to study history for the tomorrow test
I'll explain you tomorrow

Basically they for loop make j equal to B
They can just replace it with j = B
Same for all the other for loops
okay deallll
i did but i thought
I can't help you
okay its okay
First year of hisghchool
u took coding classes damn impressive
other than thatttt
im literally first 4 months of learning coding
and iour uni decided to start with c
I was wrong anyway
There's no ;
So the loop includes the loop below
And it makes sense
@spiral jungle
I was wrong , sorry
Anyway, scanf isn't a great idea
Buffer overflow is dangerous
Use fgets instead of scanf
Remember to convert it to int
First cast and then subtract
Oh wait
Nah
It's a bad idea
Just use scanf , screw security
I have a doubt
If you're using the same array
Deosn't it overwrite the other numbers?
because it only iterates through half the matrix and switch with the other half
it iterates through this part [\ of the matrix and switch it with ]
GOT it
thank u