Wednesday, August 22, 2007

c++

as a tutor in macquarie university for c++, i come across hundreds of students, 10% of them much better than me, 10% better, 70% to whom i relate, and 10% who need work on their thinking attitude first and then on the syntax.

c++ is not just programming - it's putting into a syntactical form your solution to the problem. so whenever you are going about a problem - write the solution on paper - each and every step, then start coding it - any line of solution you have problem encoding, think about it - what are the ways in which you can solve it - most of the time a combination of arrays, loops, conditions, structures/ classes, functions and some good and nice old-fashioned logic will do the trick.

as an example - try and solve this one - display a ten digit input (example 1234567890) in LED display format (the way numbers are displayed in calculators, well, atleast the old ones)

once you finish the solution, think - and then think some more and optimize your solution - how can you reduce the size of code, the number of variables, the time taken, etc.

best of luck.

No comments:

Related Posts with Thumbnails