473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

i need help in c++

12
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 :)
Jan 7 '07 #1
1 1326
baroon
12
sooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooo rrrrrrrrrrrrrrryyyyyyyyyyyyyyyyyyyyyyy

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


sorry again.
Jan 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
6
by: Robert Maas, see http://tinyurl.com/uh3t | last post by:
System login message says PHP is available, so I tried this: http://www.rawbw.com/~rem/HelloPlus/h.php It doesn't work at all. Browser just shows the source. What am I doing wrong?
0
by: Gregory Nans | last post by:
hello, i need some help to 'tree-ify' a string... for example i have strings such as : s = """A(here 's , B(A ) silly test) C(to show D(what kind) of stuff i need))""" and i need to...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
8
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl...
3
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If...
2
by: Michael R. Pierotti | last post by:
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$") Dim m As Match = reg.Match(txtIPAddress.Text) If m.Success Then 'No need to do anything here Else MessageBox.Show("You need to enter a...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.