News for hackers. Stuff that matters.
Re:The Ten Commandments for C Programmers (1987) by gigatexal on Saturday May 23, 2020 @11:02AM (#23283485)
Can you program in C effectively without pointers?
Re:The Ten Commandments for C Programmers (1987) by illuminated on Saturday May 23, 2020 @11:07AM (#23283535)
Nope, therefore you cannot do it effectively if you do not understand them :)
Re:The Ten Commandments for C Programmers (1987) by klyrs on Saturday May 23, 2020 @11:19AM (#23283614)
Depends on what you mean by "effectively." If you wanna, say, do an exhaustive search over all 4-dimensional integer vectors in a rectangular region, and print off the ones that satisfy some relationship, you don't need pointers (nevermind what printf and string literals are doing under the hood). It's a wonderfully beefy desktop calculator, in that way. But for most applications, pointers are pretty much necessary.
Re:The Ten Commandments for C Programmers (1987) by WalterBright on Saturday May 23, 2020 @05:23PM (#23286591)
Arrays in C (once passed to functions) are pointers, even when they use array syntax:

https://www.digitalmars.com/articles/C-biggest-mistake.html

Re:The Ten Commandments for C Programmers (1987) by klyrs on Saturday May 23, 2020 @08:51PM (#23288095)
You don't need arrays for the code I was describing: it's a nested for-loop on 4 ints.

But, yeah, that's a really common mistake.

Re:The Ten Commandments for C Programmers (1987) by Gibbon1 on Saturday May 23, 2020 @02:54PM (#23285421)
You can program C effectively without pointer arithmetic. Storing copies of pointers for later is usually a bad idea.