|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define PROGRAM_RUNNING 1
int main(int argc, char *argv[])
{
char option;
int console;
char gcc[3] = "gcc";
char gpp[3] = "g++";
char python[6] = "python";
char progad[1000];
char text[1000000];
int i = 0;
FILE *fp;
FILE *printer = fopen("LPT1","w");
system("clear");
puts("\n[1]save"
"\n[2]console"
"\n[3]print"
"\n.........."
"\n[n]Option"
"\n[x]Exit");
while(PROGRAM_RUNNING)
{
fflush(stdin);
/*puts("\n[1]save"
"\n[2]console"
"\n[3]open"
"\n[4]print"
"\n.........."
"\n[n]Option"
"\n[x]Exit");*/
option = getchar();
switch(option)
{
case '1':
printf("where we save the file:");
scanf("%s",&*progad);
fp = fopen(progad,"w+");
fprintf(fp,"%s",text);
break;
case '2':
puts("\n[1]python");
scanf("%d",&console);
if(console == 1){
printf("for exit to python console exit()");
system("python");
}
break;
case '3':
fprintf(printer, "%s", text);
break;
case 'n':
break;
case 'x':
return 0;
default :
text[i] = option;
i++;
break;
}
}
return 0;
}
|
|