segmentation faults

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Everybody,
Sorry if someone has covered this already--but pointers in C are behind
everything.  If you are referencing an array element like array[i] its
very similar to *(array+i).  Keep in mind though pointers are variables
like any other, you have to assign them a value before they will work.  If
you don't you'll get a segmentation violation for sure because it will
attempt to execute whatever junk value is in the pointer.  Under MSDOS
this would invariably lead to your machine locking up.  Under UNIX systems
though its smart enough to recognize that you are attempting to write
outside of your permitted memory area.  If your writing kernel or driver
code though and you do this you are running your CPU in supervisory mode
which means that you are permitted to do anything.  As I am sure Kirk
would tell you BE CAREFUL!!!!!

      Jim Wantz WB0TFK






[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux