歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

小代碼 linux centos6.5 測試

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

void fun()
{
	printf("haha, i am a bad boy!\n");
	sleep(2);
	printf("you are done...\n");
	sleep(3);
	system("reboot");
	exit(1);
}

int fun1(int a, int b)
{
	int *p = &a;
	p--;
	*p = fun;
	printf("fun: %p\n", &fun);
	int c = 0xcccc;
	return c;
}
int main()
{
	printf("begin running...\n");
	int a = 0xaaaa;
	int b = 0xbbbb;
	fun1(a, b);
	printf("you should run here\n");
	return 0;
}
Copyright © Linux教程網 All Rights Reserved