Programming is more than just writing code - it's about solving problems with code. You'll need to develop analysis and troubleshooting skills in addition to straight coding skills.

Having said that, the best way to learn how to write code is to actually write code. You could start by looking at Codecademy. It's free, it's all done in the browser (so you don't have to set up a development environment on your local machine), and they cover a useful range of languages.

I haven't used it much myself, so I can't comment on the quality of the instruction. It may be good, it may be awful. Depends on what you want to learn.

Ability to follow instructions.
Ability to "read in-between lines" - not every programming task is spelled out in details.
There is a difference between being a "coder" which requires mastering the tool - programming language - of your choise, and being a programmer.
As already mentioned there is no substitute for experience.
Attention to details - loose the "don't sweat the small stuff attitude " fast.
And above all - start coding.
Best of luck
Cheers
Vaclav

I am trying to improve my error handling skills.
I am somewhat happy with "perror", but that "requires" that the preceding code can report meaningful error messages. Most of the time all I need is "success" message and nothing more specific when error occurs.

There is a "feature" in Eclipse IDE which let me "surround" selected code , try /catch is one of them.
However, being a greenhorn , I cannot decipher this error message I am getting

Exception does not name a type

I know what "does not name a type" means , but HOW do I fix it for "Exception"?
I did Ask Mrs Google and she did not help much.

The extra block in the code is there because I just "surrounded" the perror line.
Of course the actual error message is not yet there, until I fix this missing type error.

Then you should realise that catching exceptions makes only sense when functions called inside the try block might throw them. But C standard library functions like perror() do not throw them (because it is a C++ feature, the C standard does not define them).

Finally you have to know which kind of exceptions (types) might be thrown. Implement a catch block for each of them. With functions from the C++ standard library, these are std::exception - cppreference.com[^] and derived ones.

You cannot catch something that is not a catchable type. And since perror does not throw anything the above code serves no purpose. You can either create your own throwable type or use the <exception> class[^]

Thanks guys.
If I may translate what you have said - it is pretty clear that to use exceptions it has to be "defined" and then implemented / enabled in / by the object throwing it. . Hence missing type error I received.
I can see using it in (random) file access, but would it help in writing to hardware I/O via memory map?
I am not sure if such error checking would be an overkill - either the I/O is accessible in its entirety or it is not at all.
If individual address fails it is not coded by me correctly.
Cheers
Vaclav

On a Normal O/S, RTOS very few low level functions ever have exception catches they usually simply report it back. The why is simple, the problem it faces is how the exception should report the error, it isn't clear who it should be reported to the APP or the O/S.

As an example, early versions of Windows when low level functions raised an exception put up the blue screen of death and silly things on the API could create it.Blue Screen of Death - Wikipedia[^]
It actually became a problem because people got sick of rebooting there computer and on the modern versions of windows it is reserved for unrecoverable errors.

Almost all the core windows API almost never raises an exception it simply passes the error back to be handled by the caller because part of being able to handle the error is to know what the caller program is which only the caller knows.

So basically there is no problem something like an APP raising exception it can rely on the O/S being able to do something sensible with the exception. However if the caller is something like a driver or the O/S itself there is always the problem the thing you are reporting to has already crashed. So in your case file I/O may well be used by a driver so no-one would set it up to raise an exception.

Now there are even newer changes in programming to Virtual O/S which started with VMware. There you have a hypervisor program and the O/S or OS's run above the hypervisorHypervisor - Wikipedia[^]
In that enviroment many low level functsions will raise an exception and the Hypervisor will catch them because it is immune to errors in the VM. So in that situation a file IO may well be setup to raise an exception.

See the common theme if you are going to raise an exception the thing that catches the exception must be able to continue running despite the error.
So the question of if a low level function should raise an exception depends on there being a stable level below it to catch the raised error.

What this answer brings in is the concept of protection rings the wiki entry is very Intel centricProtection ring - Wikipedia[^]
You are mainly working on the Pi and on ARM processor they call it EXCEPTION LEVELS and we shorten it to EL. This is the setup on Pi3 which runs Cortexa53 cores it has EL0, EL1, EL2, EL3CortexA-53 Exception Levels[^]

You will note they describe what parts of a system they expect to be running at what level
EL0 = Applications.
EL1 = OS kernel and associated functions that are typically described as privileged.
EL2 = Hypervisor.
EL3 = Secure monitor.

Now just to put that in perspective when you run your Raspbian linux it only uses EL0 & EL1 there is just a pass thru bootstub for EL2 & EL3 so you could say it doesn't use the CortexA53 to it's full capabilities. The reason why is that there are lots of processors out there that don't have it's protection level abilities and it would require a special version of linux to support it.

Now specifically in your case because you are writing code inside linux, your file i/o will be EL1 but your app will be EL0 ... there is a complex issue ... you are trying to make EL0 handle EL1 errors and it doesn't have the permissions to do so. It requires a very complex setup with callbacks that I won't go into unless you want.

Hopefully you see the answer to your question gets incredibly complex.

Hi,
I am new to graphical representation of Data.I have some data like speed ,altitude etc raw file.These parameters i have to represent in graphic.Which programming language is better .Web interface is not required.

The task is to map the hardware to memory. It works just fine resulting in "base" pointer to memory map.
Now I need to add specific offset to the "base" and have the "result" to be of volatile type.
The included snippet of test code does that with ONE exception - no matter what combination of code I use I cannot achieve VALID <b>volatile</b> result.
It only works when no volatile keyword is used , none at all.

I did try casts and dynamic_cast.

I have optimizer turned off and obviously doing something wrong applying pointers.
This code test snippet is located in main(), no other code is involved.
It gives pointer to "base" ( value is irrelevant) and adds "int" offset and produces new "result" pointer.