i need help in c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baroon
    New Member
    • Jan 2007
    • 12

    i need help in c++

    thaaaaanxxxxxxx xxxxxx 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,,,,,,,,t his 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",tem p1[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 :)
  • baroon
    New Member
    • Jan 2007
    • 12

    #2
    soooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo oooooooooorrrrr rrrrrrrrrryyyyy yyyyyyyyyyyyyyy yyy

    please dont solve the previos question>>>its not same what i want!!!!!


    sorry again.

    Comment

    Working...