thaaaaanxxxxxxxxxxxxx very much my friend for help but i hahe something also to help
i have programe and i need someone to change it from c to c++ .please i should finish it befor tuesday please,,,,,,,,this is the programe
__________________________________________________ ______________
/* Problem 0: Write a paragraph read from a file to the screen
in a justified format, paragraph should end with . */
/* Include libraries */
#include <stdio.h>
#include <string.h>
int i,j;
char temp1[1000];
FILE *in;
/* Excution Of Main Program Starts Here */
int main ()
{
/* Open and Read from input file */
in = fopen ("indata.dat","r");
if (in == NULL)
{
/* In case the file name does not exist, the following error
/* message will be displayed */
printf("Error : Couldn't open file indata.dat for reading...\n");
printf("Error : File does not exist... \n");
return 0;
}
else
{
/* Reading the pharagraph from file and print it in a justified mode */
printf("\n The Justified Pharagraph is >> \n\n");
fscanf(in,"%[^.].",&temp1);
j=0;
while (j<500)
{
label_start:
printf("\n ");
for (i=j+1; i<=j+60; i++)
{
if (temp1[i] == '.')
goto label_end;
if (temp1[i] == '\n')
{
j=i;
goto label_start;
}
printf("%c",temp1[i]);
}
j=j+60;
}
label_end:
fclose(in);
printf("\n---------------------------------------------------------\n");
printf(" Thank You For Using My Program \n");
printf(" Have A Nice Day \n");
printf("---------------------------------------------------------\n");
getchar();
return 1;
}}
__________________________________________________ ____
the program take the paragraph which want to justified from (txt.) for example
the paragraph is ( This is program homework to be done in C++ language for the Clanguage course,it is realy interesting course which I have enjoied it alot :)
I like programing languages...) . and the out put should be in the black screen :)