Mat
Just tell us your logic
Anonymous
Just tell us your logic
Ist iteration *(*(p+row)+col)=*(*(p+0)+0)=**p(0)=11 *(*(p+cpl)+row)=*(*(p+0)+0)=**p(0)=11 *(*(p+row)+col)=*(*(p+0)+0)=**p(0)=11 *(*(p+row)+col)=*(*(p+0)+0)=**p(0)=11 11, 11, 11, 11 Col increments to 1, *(*(p+row)+1)=*(*(p+0)+1)=**p(1)=22 *(*(p+col)+row)=*(*(p+1)+0)=**p(1)=22 *(*(p+row)+1)=*(*(p+0)+1)=**p(1)=22 *(*(p+col)+row)=*(*(p+1)+0)=**p(1)=22 22, 22, 22, 22 Col increments Now col is not less than 2, It will increment row to 1 *(*(p+row)+col)=*(*(p+1)+0)=**p(1)=22 *(*(p+col)+row)=*(*(p+0)+1)=**p(1)=22 *(*(p+row)+1)=*(*(p+0)+1)=**p(1)=22 *(*(p+col)+1)=*(*(p+0)+1)=**p(1)=22 Col increments to 1 *(*(p+row)+col)=*(*(p+1)+1)=**p(2)=33 *(*(p+col)+row)=*(*(p+1)+1)=**p(2)=33 *(*(p+row)+col)=*(*(p+1)+1)=**p(2)=33 *(*(p+col)+row)=*(*(p+1)+1)=**p(2)=33 33,33,33,33 Therefore, 11,11,11,11 22,22,22,22 22,22,22,22 33,33,33,33 Is it the correct logic?
Anonymous
@Occupato
Anonymous
??
Anonymous
Not gonna read that lul
Then dont, someone with good c skills will do it, and may help me with logic
BinaryByter
My brain is fekked up now
Wait until you get to see the context xD
Anonymous
'with good c skills' Lol
You just do the talking stuff? Right??
Anonymous
lol😂
Anonymous
BinaryByter
You just do the talking stuff? Right??
I'm sure that nobody will bother helping you. Your question features some horrible code and lacks context, besides there isnpt even a question to begin with
BinaryByter
If you are thaught such codes at university, i'm sorry for you
BinaryByter
If someone commited code like that to clinl I'd probably not accept the commit
Anonymous
Here's the real code
BinaryByter
What's the question?
Anonymous
Wanted to know logic behind the output! That's it!!
Anonymous
That printf function
BinaryByter
It increments the position in memory and uses that incremented position
BinaryByter
If its what you needed to know
BinaryByter
Tell your teachers to become good at coding
BinaryByter
Not even a C coder would code that badly
BinaryByter
@Neko_cpp is that right?
Anonymous
Someone's offended, calm down bro!! Easy✌️
Anonymous
Anonymous
Yep, i did😅, actually @Occupato has answered all my doubts so far, and he asked for my logic, so i did
BinaryByter
Wat?
Anonymous
And lame excuses does to me, code is a code.
BinaryByter
And lame excuses does to me, code is a code.
There is readable code, bad code and this above
Anonymous
Oh
BinaryByter
Exactly
BinaryByter
The code you were given is so bad, i'd not even considerconsider answering that question in an exam
BinaryByter
Well okay maybe i would
BinaryByter
It is full of useless pointer arithmetic, useless (redundant) pointern
BinaryByter
Etc
BinaryByter
Besiden, it's C
MᏫᎻᎯᎷᎷᎬᎠ
Daaamn C is very fucking complicated
BinaryByter
Daaamn C is very fucking complicated
No, it's just that the coders were drunk
BinaryByter
If you happen to commit such shit to clinl, i will happily kill you :)
MᏫᎻᎯᎷᎷᎬᎠ
Oh
BinaryByter
Because, yes this is possible in cpp aswell
MᏫᎻᎯᎷᎷᎬᎠ
I was commetting such thing
BinaryByter
Huh?
BinaryByter
Reminder: comments in code are evil
BinaryByter
(exceptions to be made)
MᏫᎻᎯᎷᎷᎬᎠ
Kidding
BinaryByter
Okay xDD
MᏫᎻᎯᎷᎷᎬᎠ
Reminder: comments in code are evil
I saw a comment in your code
BinaryByter
But still, keep that in mind
BinaryByter
I saw a comment in your code
Either it was a bad comment, or a todo comment, or a nesnecary comment
MᏫᎻᎯᎷᎷᎬᎠ
I saw a comment in your code
//Array out of bounds
MᏫᎻᎯᎷᎷᎬᎠ
//Array out of bounds
When you were returning a NULL to reference
BinaryByter
That one is nessecary because making an empty function that handles outofbound would be overkill
MᏫᎻᎯᎷᎷᎬᎠ
I know one day you'll give up from that logic
MᏫᎻᎯᎷᎷᎬᎠ
I know one day you'll give up from that logic
Comments says alot about the design
Anonymous
Ok
Anonymous
Lol,i passed the test😁, so I guess am human
BinaryByter
Though you might refactor the if statement's predicate to be if (indexIsOutOfBounds(index))
BinaryByter
Create that private function for me please and refactor that function
BinaryByter
Or actually
BinaryByter
No don't
BinaryByter
Since it's an else statement
BinaryByter
I will refactor it myself
MᏫᎻᎯᎷᎷᎬᎠ
Lol,i passed the test😁, so I guess am human
You must sacrifice your blood to prove us that you are a real human being That's how you are gonna join C++inati secret group
BinaryByter
No
Comments lie
BinaryByter
Comments lie
Comments like to move around in a file
BinaryByter
Comments disturb the reading flow
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
Comments make you too lazy to code well
MᏫᎻᎯᎷᎷᎬᎠ
Comments for others
MᏫᎻᎯᎷᎷᎬᎠ
Not for you
BinaryByter
No
You lack experience
MᏫᎻᎯᎷᎷᎬᎠ
And it can be little for learning purposes