What would an ideal intro or "crash" course in C look like? Would they differ? Based on goal of reading or writing?
-
-
Of course you need some minimal intro of arrays to do argv[i], just passing to strtol/strtod at this point though.
Show this thread -
Then do as much as makes sense (student interest, time available, etc.) without strings - expressions, conditionals, loops, functions, ...
Show this thread
End of conversation
New conversation -
-
-
seems reasonable. I have a cute little brute-force sudoku solver in C, it would be reasonable to work up to something like that.
-
Yes. You could actually relax the "input only from cmdline" rule if you use input redirection and require properly formatted input text files (bonus: teaching input validation).
-
For example sudoku board as textfile array of digits and dots/x's/whatever, read via getchar loop.
-
it's definitely not awesome code but here's what I wrote a long time ago:https://pastebin.com/hLqmGn7j
-
At first glance, doesn't look bad at all for a teaching exercise.
-
I think that given the sanitizers + compiler warnings, this kind of program should be pretty easy for people learning C to get
End of conversation
New conversation -
-
-
my Intro to C class had us use scanf; it wasn't too bad
-
I don't like it because it requires you learn pointers too early and because it's anti-idiomatic (nobody actually uses scanf for input reading).
End of conversation
New conversation -
-
-
Do not start with printf. Format strings are confusing to beginners. Start with language basics; if you need output, use puts. Dedicate a session to printf a bit later, when you've done the typing system.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.