....and it is in no way related to Code::Blocks.
EDIT:
To elaborate, you are writing to a read-only memory page, which of course causes a segmentation fault, this is normal.
Such issues, however, belong to a "C programming" or "General programming" forum, not to the Code::Blocks forums.