如何编写历史记录敏感代码? [英] how can I write a history sensitive code?

查看:71
本文介绍了如何编写历史记录敏感代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用C语言编写一个对历史敏感的程序.
我的意思是,它应该能够自行生成代码.我知道可以通过使用JDeveloper来实现,但是我需要将其开发为C.

I want to write a program in C language that should be history sensitive.
I mean, it should be able to generate codes by itself. I know that it is possible by using JDeveloper, but i need to develop it into C.

推荐答案


如果您的意思是要在其输出中生成其代码的程序,则可以将其作为
完成
Hi
If u mean program to generate it''s code as it''s output then it can be done as

main()
{
char *c="main(){char *c=%c%s%c;printf(c,34,c,34);}"
printf(c,34,c,34);
} 









or

//suppose test.c is your file name then

#include "stdio.h"
main()
{
 FILE *p;
 char ch;
 p=fopen("test.c","r");
 while(ch=getc(p)!=EOF)
 ch=putchar(p);
}




试试吧.

Ak




Try it out.

Ak


这篇关于如何编写历史记录敏感代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆