Could anybody help me explaining these lines of code?
char code[] = \"paste your shellcode here\";
int main(int argc, char **argv)
{
int (*func)();
fu
Have you tried Googling for "paste your shellcode here"? The first second (now that this question is first LOL) result returned is Corelan Team's Exploit writing tutorial part 9: Introduction to Win32 shellcoding where it's all explained:

In a nutshell, it's merely a small utility C application to test shellcode that will be used later on in following parts of the tutorial for this same purpose. The rest is explained in the tutorial.