Basics of C++

Hi Guys,

You must be like damn is it our 1st semester or what..? But anyways back to the old school days "cout<>"days.

I've recently started working with it as a part of my Electronics course. But I still get stuck in codes. The basics. Although I've reached till Classes and Data Encapsulation but still when writing the code I feel like not able to structure it properly.

Could you help me out with it.? I need to get robust in coding but not getting hold of it. Share your views about it and how'd you overcome this back in your Uni days.

Are you using C++ on microcontrollers?

[quote=“PsychedelicBreakfast, post:2, topic:16491”]

Are you using C++ on microcontrollers?

[/quote]

Yup at times…but usually I work on MikroC…it has predefined libraries…but to learn C++ is something I’m looking forward to.

If you can work on MikroC, the basics of C/C++ should already be clear to you.

[quote=“Asad, post:4, topic:16491”]

If you can work on MikroC, the basics of C/C++ should already be clear to you.

[/quote]

they are but at times i get stuck in nested loops…you know petty issues… I’m quite good at writing and reading code without any syntax issue…But implementing my own logic gets me screwed most of the times.

I need a way out of it…an exercise or something.

You just need to practice more to understand the microcontroller features at your disposal and how to best use them. Perhaps studying examples and reading datasheets would be helpful for you.

Well practising would make you perfect. However, to improve logic, you should spare some time visiting and solving problems on the following sites:

http://projecteuler.net/

http://www.codechef.com/

[quote=“rafay18, post:7, topic:16491”]

Well practising would make you perfect. However, to improve logic, you should spare some time visiting and solving problems on the following sites:

http://projecteuler.net/

http://www.codechef.com/

[/quote]

Thanks will look into it…

Write GAMES. For example, tic tac toe, or utilize classes and data encapsulation and build your own small game. This can help really well in understanding and makes one proficient in writing code.

Take a look at this which will help clear inheritance with example of making a 'game':