Jan 20, 2016 at 2:41pm UTC
i need a c++ project fr text editor
can sumone help
Jan 20, 2016 at 2:47pm UTC
Do you you mean that you want someone to recommend a text editor, that you can use to write a C++ project?
Or do you mean that you want someone to write you some C++ code that implements a text editor?
Because if it's the second of those two, you should really be posting in the "Jobs" forum.
Jan 20, 2016 at 4:11pm UTC
Perhaps he means that he anticipates working on a C++ project, and he'd like recommendations for a French language text editor which he might use while writing code.
Jan 21, 2016 at 6:49pm UTC
i need a c++ code
hve written it in c but need to translate in c++.
need help to write it in c++
Jan 21, 2016 at 7:06pm UTC
Post in the job section and dont forget to mention how much you are willing to pay.
Jan 21, 2016 at 7:25pm UTC
How To Make A Very Simple Text Editor Using MFC in Visual Studio
http://www.codeproject.com/Articles/12474/How-To-Make-A-Very-Simple-Text-Editor-Using-MFC-in
Jan 22, 2016 at 3:18am UTC
Then be prepared to PAY for someone to do it, several thousand US dollars at minimum.
Jan 22, 2016 at 6:07am UTC
i hve prepared it
jst need to chnge in C++
Jan 22, 2016 at 9:47am UTC
Can you tell us abit more.
How many lines of code?
Is it fully working?
Why do you want to change it to C++?
Jan 23, 2016 at 1:42pm UTC
this is the code
i hve changed a bit!!!
need advice to do more!
#include<stdio.h>
#include<conio.h>
#include<process.h>
using namespace std;
int i,j,ec,fg,ec2;
char fn[20],e,c;
FILE *fp1,*fp2,*fp;
void Create();
void Append();
void Delete();
void Display();
int main()
{
do {
printf("\n\t\t***** TEXT EDITOR *****");
printf("\n\n\tMENU:\n\t-----\n ");
printf("\n\t1.CREATE\n\t2.DISPLAY\n\t3.APPEND\n\t4.DELETE\n\t5.EXIT\n");
printf("\n\tEnter your choice: ");
scanf("%d",&ec);
switch(ec)
{
case 1:
Create();
break;
case 2:
Display();
break;
case 3:
Append();
break;
case 4:
Delete();
break;
case 5:
exit(0);
}
}while(1);
return 0;
}
void Create()
{
fp1=fopen("temp.txt","w");
printf("\n\tEnter the text and press '.' to save\n\n\t");
while(1)
{
c=getchar();
fputc(c,fp1);
if(c == '.')
{
fclose(fp1);
printf("\n\tEnter then new filename: ");
scanf("%s",fn);
fp1=fopen("temp.txt","r");
fp2=fopen(fn,"w");
while(!feof(fp1))
{
c=getc(fp1);
putc(c,fp2);
}
fclose(fp2);
break;
}}
}
void Display()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end1;
}
while(!feof(fp1))
{
c=getc(fp1);
printf("%c",c);
}
end1:
fclose(fp1);
printf("\n\n\tPress any key to continue...");
getch();
}
void Delete()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end2;
}
fclose(fp1);
if(remove(fn)==0)
{
printf("\n\n\tFile has been deleted successfully!");
goto end2;
}
else
printf("\n\tError!\n");
end2: printf("\n\n\tPress any key to continue...");
getch();
}
void Append()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end3;
}
while(!feof(fp1))
{
c=getc(fp1);
printf("%c",c);
}
fclose(fp1);
printf("\n\tType the text and press 'Ctrl+S' to append.\n");
fp1=fopen(fn,"a");
while(1)
{
c=getch();
if(c==19)
goto end3;
if(c==13)
{
c='\n';
printf("\n\t");
fputc(c,fp1);
}
else
{
printf("%c",c);
fputc(c,fp1);
}
}
end3: fclose(fp1);
}
Last edited on Jan 23, 2016 at 1:58pm UTC
Jan 23, 2016 at 1:45pm UTC
That is c++, not C. You said your code was in C and you needed it translated.
Jan 23, 2016 at 1:58pm UTC
#include<stdio.h>
#include<conio.h>
#include<process.h>
using namespace std;
int i,j,ec,fg,ec2;
char fn[20],e,c;
FILE *fp1,*fp2,*fp;
void Create();
void Append();
void Delete();
void Display();
int main()
{
do {
printf("\n\t\t***** TEXT EDITOR *****");
printf("\n\n\tMENU:\n\t-----\n ");
printf("\n\t1.CREATE\n\t2.DISPLAY\n\t3.APPEND\n\t4.DELETE\n\t5.EXIT\n");
printf("\n\tEnter your choice: ");
scanf("%d",&ec);
switch(ec)
{
case 1:
Create();
break;
case 2:
Display();
break;
case 3:
Append();
break;
case 4:
Delete();
break;
case 5:
exit(0);
}
}while(1);
return 0;
}
void Create()
{
fp1=fopen("temp.txt","w");
printf("\n\tEnter the text and press '.' to save\n\n\t");
while(1)
{
c=getchar();
fputc(c,fp1);
if(c == '.')
{
fclose(fp1);
printf("\n\tEnter then new filename: ");
scanf("%s",fn);
fp1=fopen("temp.txt","r");
fp2=fopen(fn,"w");
while(!feof(fp1))
{
c=getc(fp1);
putc(c,fp2);
}
fclose(fp2);
break;
}}
}
void Display()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end1;
}
while(!feof(fp1))
{
c=getc(fp1);
printf("%c",c);
}
end1:
fclose(fp1);
printf("\n\n\tPress any key to continue...");
getch();
}
void Delete()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end2;
}
fclose(fp1);
if(remove(fn)==0)
{
printf("\n\n\tFile has been deleted successfully!");
goto end2;
}
else
printf("\n\tError!\n");
end2: printf("\n\n\tPress any key to continue...");
getch();
}
void Append()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end3;
}
while(!feof(fp1))
{
c=getc(fp1);
printf("%c",c);
}
fclose(fp1);
printf("\n\tType the text and press 'Ctrl+S' to append.\n");
fp1=fopen(fn,"a");
while(1)
{
c=getch();
if(c==19)
goto end3;
if(c==13)
{
c='\n';
printf("\n\t");
fputc(c,fp1);
}
else
{
printf("%c",c);
fputc(c,fp1);
}
}
end3: fclose(fp1);
}