C: Good Habits re: Transitioning to C++

后端 未结 13 624
梦毁少年i
梦毁少年i 2020-12-13 02:47

I\'ve been learning C at Varsity for just shy of 2months now, and next year we\'ll be moving on to C++.

Are there any habits I should get into with my C programmin

13条回答
  •  天命终不由人
    2020-12-13 03:13

    Here are some points :

    1) Make sure you are proficient in Pointers. Focus on how Arrays and pointers works, what are the similarities and differences between them.

    2) The best way to perfect c is to write programs. Write as many as you can. For starter you can write custom functions for some of the library functions.You may try your hands on Strcpy, strcmp, strncpy, memcpy, memmove.

    3) Learn how to Debug.(Gdb is really cool).

    4) Start following a particular coding style and try to stick with it.

    5) Always furnish your code with meaningful comments.

提交回复
热议问题