Is there such a thing as dangerous knowledge when just starting out learning C or C++? In other words what is the likelihood that I could "accidently" write and compile a code snippet that formats the hard drive, renders the OS unusable, or worse case scenario silently deletes random files on the computer?
Stuff like the veritable
format C:/
or
rm -rf /
If I am just starting out tinkering with low level C code or even messing with libraries what are some basic things to be aware of?
If there are in fact these potential dangers lurking what is a good strategy for keeping the dev environment sandboxed from your day to day system? Are certain areas of tinkering better left to a virtualized environment?
No need to go into explicit code examples, but more general advice is what I am curious about.
I suppose a good rule of thumb is: Be sure you have an understanding of the code before you compile and run some random code snippet you find on the web.
Note: I am on OS X if that is relevant.
I recognize that there is no substitute for a good backup system. Hack away destroy your computer, at most you lose a day or hours work and have to restore.