i need help please this program in c and ineed someone to change it in to c++ (change the format).please i need it as soon as u can before tuesday:)
__________________________________________________ __
/* 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<iostream>
#include <string.h>
using namespace std;
int i,j;
char temp1[1000],c;
FILE *in;
/* Excution Of Main Program Starts Here */
int main ()
{
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 number of records in the file */
printf("\n The Justified Pharagraph is >> \n\n");
fscanf(in,"%[^.].",&temp1);
j=0;
while (j<500)
{
label_start:
while (temp1[j] == ' ')
j=j+1;
if (temp1[j] != '\n');
printf("\n %c",temp1[j]);
for (i=j+1; i<=j+60; i++)
{
if (temp1[i] == '.')
goto label_end;
if (temp1[i] == '\n')
{
j=i+1;
cout<<(c,temp1[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 read the paragraph from (txt.) and make the paragraph with justified . 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 livepooool enjoied it alot :)
I like programing languages...)