User Tools

Site Tools


user:kkrauss1:portfolio:signal_tester_1

Project: Signal tester

A project for C/C++, Data Structures, and System Programming by Karl Krauss for fall 2011.

This did not take long at all, it was just my attempt at playing with signals.

Objectives

The purpose of this project was to create a program to play with signals

Background

I had never played with signals before, Matt lectured and we wrote a basic program, I wanted to continue and wrote a couple of my own.

Attributes

Cprog attributes

  • variables
  • pointers
  • i/o
  • functions
  • arrays

Systems programming

  • Signals

Code

This is the code:

#include <signal.h>
#include <stdio.h>
 
void intu();
void seg();
void recurse();
 
int main()
{
    char *array;
	signal(SIGINT, intu); //interrupt aka ctrl c
	signal(SIGSEGV, seg);// good ol seg fault why is it V instead of F?
	getchar();
	printf("%c\n", *array);
	return 0;
}
 
void intu()
{
	printf("You tried to interrupt me but I won't let you!\n");
}
 
void seg()
{
	printf("I segmented!\n");
 
}
void recurse()
{
	recurse();
user/kkrauss1/portfolio/signal_tester_1.txt · Last modified: 2011/12/12 16:34 by kkrauss1