This is one of many examples of a C code skeleton for shellcode testing.

Code:
#include<stdio.h>
#include<string.h>
...