I am very very sure there is somebody who can help me!

i am sorry but i nead nead body to help me for a question regarding C lenguage!
i am reading a file and after doing some calculations on it writing another file.now i have six lines of data in the reading file but my programe just reads on line and writes the corresponding answer in writing file.i want the programe to read all the six lines and then write the correspoding six linx in the writing file.
could some body help me !
this is how i am scaning :
while((io=fscanf(fr,"%c %d %d %d %d",&letter,&hoursin,&minutesin,&hoursout,&minutesout)!= EOF))
and this is how i am printing:
fprintf(fw,"%c\t%d\t%d\t%d\t%d\t%.2lf\n",letter,hoursin,minutesin,hoursout,minutesout,totalcharge)

I don't remember the command exactly but there is a command in C that you can get the size of the file that you want to read and the you can read the file with this known size with "fread" command.
Payam

Similar Messages

  • When I try to install the latest version (10.5) of iTunes, the following message appears: "There was a problem with this Windows Installer package. A program running during installation is terminated unexpectedly." Is there somebody who can help me?thanks

    When I try to install the latest version (10.5) of iTunes, the following message appears: "There was a problem with this Windows Installer package. A program running during installation is terminated unexpectedly." Is there somebody who can help me?thanks

    I used this site and it fixed my problems. Hoping it will help with yours too
    http://support.microsoft.com/mats/Program_Install_and_Uninstall

  • Regarding the wireless problem of my T60. Hope there is someone who can help me out. Thx.

    I have read some of the posts and i found out that some of the Thinkpad users have the problem of unable to connect wireless network using Access Connection but not Window wireless network connection. For my case, i have connect the network with both of them. In fact, when i use either one to connect, the other would be connected too.
    The problem is, sometimes when i use my wireless network, my wireless would be switched off automatically, and the wireless light is then off, and after that i cannot switched the wireless on again. I tried on it using access connection, failed. I tried Fn+F5 to on it, but no matter how many times i click on 'on', there would not be any response. The only thing i can do after this is to restart to laptop.
    I called Lenovo Support to help me solve the problem, but still failed. The first time they asked me to installed some drivers and reinstall my Intel(R) Pro/Wireless 3945ABG Network Connection. These files included 79uj29us which is a bios update, 7kwc50ww which is the wireless driver installation, 7tvu12ww which is the hotkey driver update, and last 7tku03ww, a power management driver update. But the problem remains. The 2nd time i called, they asked me to uninstall my Access Connection and use window wireless connection as they may cause conflict to each other, and they asked me to uncheck the option of 'Allow this computer to turn off this device to save power' in the power management of wireless drive in device manager, but problem persists. The last time i called the technician and he said they only can check if it is a hardware problem and there most probably be nothing else they can do for my softwares and drivers, and he also believed that it might be the network configuration of my service provider that cause the problem, but i personally do not think so as it is quite hard to believe that the my service is switching off my wireless hardware and i have other laptop in my house too but they do not experience this problem.
    Last night i discovered something new, when the wireless is off automatically again, i ran a test on the the wireless device using PC Doctor, for PCI express status test, it passed, for the wireless connectivity and signal strength test, results showed there was 'no connection', when it comes to network link test, it showed 'internal error', the TCP/IP network connection test showed failed. Then i restarted it and ran the test with the wireless switched off by my self, the PCI express status test passed too, but the remaining four test all showed 'no connection'.
    I really hope if there is someone there to help me out to solve the problem or to enlighten me what the real problem is, could it be software or hardware problem, or could it be other problems like registry or what? I greatly appreciate if anyone can help me to solve this. Thanks alot.
    Message Edited by cat_felix on 06-13-2008 09:54 PM
    Message Edited by cat_felix on 06-13-2008 09:55 PM
    Message Edited by cat_felix on 06-14-2008 04:15 AM

    I have uninstalled my Access Connection, but this problem seems to persist. IBM technician have changed the wireless card of my T60, the first few days after it was changed was very fine, no problem at all. About a week later, the problem occured again, and it happened quite frequently after that occurence. Now i really have no idea what is the cause and how to solve it. Will be greatful if there is anyone that can help me.

  • Network in System Prefs won't load -  in this big world surely there is someone who can help me!

    After returning home after a house refubishment, had to get TalkTalk engineers to reconnect me.  Now have internet and Fibre Optic access.  But, when I click on the Network icon, it keeps saying: Loading Network ...'  But never does.  I am not very computer savvy.  Nobody in these communities speak English, so to speak.  I can see that people are looking at my pleas, but nobody is replying.  Hair being pulled out as I type!  Please help.

    I have uninstalled my Access Connection, but this problem seems to persist. IBM technician have changed the wireless card of my T60, the first few days after it was changed was very fine, no problem at all. About a week later, the problem occured again, and it happened quite frequently after that occurence. Now i really have no idea what is the cause and how to solve it. Will be greatful if there is anyone that can help me.

  • HI THERE!IS THERE ANY ONE WHO CAN HELP ME HAVING TROUBLE WITH MY IPHONE 3GS AFTER UPGRADING TO IOS5.0 IT WONT READ THE SIM AND NO SERVICE  AND IT WONT ACTIVATED.PLEASE HELP

    HI THERE IS THERE ANYONE WHO CAN HELP ME?I UPGRADE MY IPHONE 3GS TO IOS5 AND NOW IT WONT ACTIVATE AND SAYS THE SIM CARD IS NOT SUPPORTED I CHANGE FOR ANEW SIM ALREADY BUT STILL WONT ACTIVATE.PLEASE HELP

    you're responding to a post that's almost 2 months old. Time to post your own thread.

  • Has somebody who can help me please  with JavaMail and JSP ?

    I am new in JSP
    And I would wish to create a JSP to send an email with attachment.
    For the compilation of my JavaBeans I use JBuilder 9 Personnel version
    Then I have j2sdk1.4.0
    In C:\j2sdk1.4.0\
    For the installation of the API javamail
    it is necessary to download two jar files Mail.jar and activation .jar
    http://java.sun.com/products/javamail/javadocs/index.html
    it is done!
    then, I copied my two files mail.jar and activation.jar in the directory
    C:\j2sdk1.4.0\lib
    And in
    C:\jBuilder 9 \jdk1.4\lib
    I have family Windows XP
    Then from DOS in the the directory c:\ Documents and Settings\MEBARKIA
    I have to add this line:
    SET CLASSPATH=c:\j2sdk1.4.0\lib\mail.jar;c:\j2sdk1.4.0\lib\activation.jar;
    Finally,
    for a test, I downloaded an example of Javabean from : http://java.sun.com/developer/qow/archive/74/
    the source code is:
    import java.beans.*;
    import java.util.*;
    import java.io.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class XYZMail extends Object
    implements java.io.Serializable {
    private ArrayList mailTo
    = new ArrayList();
    private String mailFrom ;
    private String mailSubject ;
    private String mailMessage ;
    private String mailHost;
    private ArrayList mailAttachments = new ArrayList();
    private Properties props;
    private javax.mail.Session sess;
    private InternetAddress[] address
    = { new InternetAddress() };
    public XYZMail() {
    props = new Properties( ) ;
    props = System.getProperties();
    public long sendMail () throws MessagingException {
    props.put("mail.smtp.host", getMailHost() );
    sess = javax.mail.Session.getDefaultInstance(props, null);
    sess.setDebug( Boolean.valueOf( "false" ).booleanValue() );
    int i = 0;
    MimeMessage msg = new MimeMessage(sess);
    msg.setFrom(new InternetAddress( getMailFrom() ));
    for ( Iterator itr = mailTo.iterator( ); itr.hasNext(); ) {
    address[i] = new InternetAddress((String) itr.next()) ;
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSubject( getMailSubject() );
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setText( getMailMessage() );
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    if ( ! mailAttachments.isEmpty() ) {
    MimeBodyPart mbp2 = new MimeBodyPart();
    FileDataSource fds=new FileDataSource( (String)
    mailAttachments.get(0) );
    mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setFileName( (String) mailAttachments.get(0) );
    mp.addBodyPart(mbp2);
    msg.setContent(mp);
    msg.setSentDate(new Date());
    Transport.send(msg);
    return 1;
    public ArrayList getMailTo ( ) {
    return mailTo;
    public String getMailFrom ( ) {
    return mailFrom;
    public String getMailSubject ( ) {
    return mailSubject;
    public String getMailMessage ( ) {
    return mailMessage;
    public ArrayList getMailAttachments ( ) {
    return mailAttachments;
    public String getMailHost ( ) {
    return mailHost;
    public void setMailHost ( String host ) {
    mailHost = host;
    public void setMailAttachments ( ArrayList attachments ) {
    mailAttachments = attachments ;
    public void setMailMessage ( String msg ) {
    mailMessage = msg ;
    public void setMailSubject ( String subject ) {
    mailSubject = subject ;
    public void setMailFrom ( String from ) {
    mailFrom = from;
    public void setMailTo ( ArrayList to ) {
    mailTo = to;
    I have all these error messages:
    "XYZMail.java" : Erreur No. 704 : acc?s impossible au r?pertoire javax\mail en ligne 6, colonne 1
    "XYZMail.java" : Erreur No. 704 : acc?s impossible au r?pertoire javax\mail\internet en ligne 8, colonne 1
    "XYZMail.java" : Erreur No. 704 : acc?s impossible au r?pertoire javax\activation en ligne 9, colonne 1
    "XYZMail.java" : Erreur No. 302 : classe javax.mail.Session non accessible ; aucune classe ni source trouv? pour javax.mail.Session en ligne 22, colonne 20
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 23, colonne 9
    "XYZMail.java" : Erreur No. 300 : classe MessagingException introuvable dans classe gestionbadges.XYZMail en ligne 31, colonne 32
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 24, colonne 9
    "XYZMail.java" : Erreur No. 302 : classe javax.mail.Session non accessible ; aucune classe ni source trouv? pour javax.mail.Session en ligne 34, colonne 19
    "XYZMail.java" : Erreur No. 300 : classe MimeMessage introuvable dans classe gestionbadges.XYZMail en ligne 38, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeMessage introuvable dans classe gestionbadges.XYZMail en ligne 38, colonne 23
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 40, colonne 17
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 42, colonne 18
    "XYZMail.java" : Erreur No. 302 : classe Message.RecipientType non accessible ; aucune classe ni source trouv? pour Message.RecipientType en ligne 46, colonne 27
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 50, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 50, colonne 25
    "XYZMail.java" : Erreur No. 300 : classe Multipart introuvable dans classe gestionbadges.XYZMail en ligne 53, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeMultipart introuvable dans classe gestionbadges.XYZMail en ligne 53, colonne 20
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 57, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 57, colonne 25
    "XYZMail.java" : Erreur No. 300 : classe FileDataSource introuvable dans classe gestionbadges.XYZMail en ligne 59, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe FileDataSource introuvable dans classe gestionbadges.XYZMail en ligne 59, colonne 24
    "XYZMail.java" : Erreur No. 300 : classe DataHandler introuvable dans classe gestionbadges.XYZMail en ligne 61, colonne 25
    "XYZMail.java" : Erreur No. 300 : variable Transport introuvable dans classe gestionbadges.XYZMail en ligne 70, colonne 1
    Thanks for your's help!!!!!

    Thank you very much for your answer wew64.
    Yes, I have a local server TOMCAT
    But the problem
    It is on the compilation I do not arrive has to compile my javabean XYZMail java
    With jbuilder 4
    However I have to configure my CLASSPATH on the level of DOS
    And on the variables of enivrements of Windows XP.
    I copied the two files mail.jar and activation.jar everywhere
    In
    C:\j2sdk1.4.0\lib
    And in
    C:\j2sdk1.4.0\jre
    C:\j2sdk1.4.0\jre\lib
    Even case with
    c:\jBuider 4
    thanks.

  • Is there any one who can help me solve this?

    Hi.
    I'm taking AP Computer Scinece AB in high school now.
    I've been assigned many programs so far. But.. I can't figure them out.
    There are two programs I need your help. So..Please!!!!!! Help Me!!!!
    Please!! Enjoy helping me!
    <Program #1>
    It's divided into three small programs and I've figured out one of them, which was the easiest one..You will be able to see the programs if you click on the link below.
    (page1)
    http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=2&page=1
    (page2)
    http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=3&page=1
    <Program #2>
    http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=4&page=1
    The way I figured out first part of program #1 was like this :
    public class ThreeX1
    public static void main ( string[] org )
    system.out.println ();
    int startValue = 21;
    int count = 0;
    while (startValue >1)
    count ++;
    if (startValue % 2 == 0)
    startValue = startValue/2;
    else
    startValue = 3*startValue +1;
    system.out.println ( count );
    ===================================================
    From there, for the second and third programs of program #1, I tried to figure it out by using 'for' statement instead of 'while', but I couldn't.
    So..Please help me out.. Thank you
    or you can e-mail me too. It would be great too.
    add. : [email protected]

    I probably shouldn't be doing your homework but here it is:
    public class ThreeX2{
         public static void main ( String[] org ){
              int startValue = 2;
              while(startValue<100){
                   System.out.print(startValue);
                   System.out.print("\t");
                   System.out.println(timesToGetToOne(startValue));
                   startValue++;
         private static int timesToGetToOne(int intForValue){
              int count = 0;
              while (intForValue!=1){
                   count ++;
                   if (intForValue % 2 == 0)
                        intForValue = intForValue/2;
                   else
                        intForValue = 3*intForValue +1;
              return count;
    public class ThreeX3{
         public static void main ( String[] input ){
              int maximumTries = 1000000;
              int numberOfitterations = 10;
              try{
                   numberOfitterations = new Integer(input[0]).intValue();
              }catch(Exception e){
              try{
                   maximumTries = new Integer(input[1]).intValue();
              }catch(Exception e){
              int startValue = 2;
              while(startValue<maximumTries){
                   if(timesToGetToOne(startValue)==numberOfitterations){
                        System.out.print("When startvalue is: ");
                        System.out.print(startValue);
                        System.out.print(" it will take exatly ");
                        System.out.print(timesToGetToOne(startValue));
                        System.out.println(" iterations to get to 1.");
                        // remove the next line and it will show all values that
                        // takes numberOfitterations amount of times to get to 1
                        break;
                   startValue++;
         private static int timesToGetToOne(int intForValue){
              int count = 0;
              while (intForValue!=1){
                   count ++;
                   if (intForValue % 2 == 0)
                        intForValue = intForValue/2;
                   else
                        intForValue = 3*intForValue +1;
              return count;
    }Problem 3 is diffucult, since the input is one date I assume that the current reading is for this date. I don't
    know the date of the previous reading so I cannot calculate if the consumption is between June through
    Ocober.
    your Main method shoud have 4 inputs date accountNumber currentReading previousReading
    Your main function would look like this:
         public static void main ( String[] input ){
              Calendar date=null;
              int accountNumber = 0;
              int currentReading = 0;
              try{
                   String[] s = input[0].split("/");
                   date = Calendar.getInstance();
                   date.set(Calendar.YEAR,new Integer(s[2]).intValue());
                   date.set(Calendar.MONTH,new Integer(s[0]).intValue()-1);
                   date.set(Calendar.DAY_OF_MONTH,new Integer(s[1]).intValue());
              }catch(Exception e){
                   System.out.println("cannot get date, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
              try{
                   accountNumber = new Integer(input[1]).intValue();
              }catch(Exception e){
                   System.out.println("cannot get account number, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
              try{
                   currentReading = new Integer(input[2]).intValue();
              }catch(Exception e){
                   System.out.println("cannot get current reading, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
              try{
                   previousReading = new Integer(input[3]).intValue();
              }catch(Exception e){
                   System.out.println("cannot get previous reading, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
    // check the date between june and oct:
    // (5>date.get(Calendar.MONTH))&&(9<date.get(Calendar.MONTH))

  • I can't download the apps with big size like need for spees, but in apps with normal size(less than 100KB)there is no problem,is there any body who can help me?

    I can't download the apps with big size like need for spees

    Have a little patience. 4 minutes is only a short time for someone to find your post and reply to it. Also clicking on "This Solved My Problem" marks your problem as solved so many folks that may otherwise help will pass the question by since it is "solved."
    I suggest you start a new question that gives a good title to a specific problem. Then in the body of the thread describe the problem in detail, tell us what steps you have tried so far to correct the problem, what happened, and what error messages you received.

  • Hi are there some who can help i am trying to update my programs in app store

    hi are there some who can help i am trying to update garageband ,iphoto and iMovie on my iMac, but it´s not my apple id  it will use to the update, so i dont now the email and the  password for the email used, and i cant change it to my apple id
    my problem started after i updated to maverick
    i hope there are someone who can help ???

    hi are there some who can help i am trying to update garageband ,iphoto and iMovie on my iMac, but it´s not my apple id  it will use to the update, so i dont now the email and the  password for the email used, and i cant change it to my apple id
    my problem started after i updated to maverick
    i hope there are someone who can help ???

  • Is there anyone who can help me to contact the apple customer service? Because i want to know why they are diducted mt credit card more than the amount which is written on there apple store price? They are taken more!

    Why the apple store taken more amount more than the amount written on their prices? Is there any one who can help me to contact the apple customer services. Thanks!

    Some country's might not include tax in their prices, and if you changed or added your credit card details whilst making the purchase then a small temporary holding charge may also have been placed - in which case that should disappear within a few days (http://support.apple.com/kb/HT3702). Some apps also then allow you to make in-app purchases (though you can disable that via Settings > General > Restrictions)

  • Hey ammm who can help me y need help but i don´t speak english very well, hey ammm who can help me y need help but i don´t speak english very well

    hey ammm who can help me y need help but i don´t speak english very well, hey ammm who can help me y need help but i don´t speak english very well

    Post your question in your native language. There are often Spanish speakers who participate in these forums.
    Regards.

  • My iphone4S stolen, who can help check ICCID, thank you very much

    My iphone4S stolen, who can help check ICCID, my IMEI **** thank you very much
    <Edited By Host>

    Sorry for your lost.
    Report to the police, carrier and change all your password that were used on iPhone.
    Lost or Stolen
    http://support.apple.com/kb/HT2526

  • Is there anyone there? I hope there is someone who can you understand this problem and have the common sense to respond?  I open gmail. I want to save an email to one of my folders. I position my cursor over the appropriate Folder icon or by choice, to th

    Is there anyone there? I hope there is someone who can you understand this problem and have the common sense to respond?
    I open gmail. I want to save an email to one of my folders.
    I position my cursor over the appropriate Folder icon or by choice, to the Trash.
    The friendly finger pointing cursor icon changes to an arrow icon.
    The hand icon allows me flawless access to opening and/or moving emails.
    The arrow, however does not open the link.
    On the Google menu bar the cursor hand with finger opens the links to Everett (my name), Search, Images, Maps and Play.
    When I attempt to open the remaining links in the menu bar (YouTube, News, Gmail, Drive, Calendar and More) the arrow icon replaces the hand. The arrow icon does not work. It will not activate these links.  Nor does it open email messages in the Inbox.
    Usually I reset, even reboot Safire and sometimes the problem goes away, then reappears.
    Can you imagine if this condition should it happen to a tech savvy Google Support person? Perhaps one can share and make my problem go away.
    I am considering dropping Google as my mail source. Unfortunate!
    Everett Halvorsen
    [email protected]
    718.490.3824

    I have uninstalled my Access Connection, but this problem seems to persist. IBM technician have changed the wireless card of my T60, the first few days after it was changed was very fine, no problem at all. About a week later, the problem occured again, and it happened quite frequently after that occurence. Now i really have no idea what is the cause and how to solve it. Will be greatful if there is anyone that can help me.

  • Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal, How can i know whether my phone is in use??

    Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal bcz it seems to be wiped out all data including settings. it might be in use somewhere turning new fresh Gadget.  How can i know whether my phone is in use??

    You would know for a fact if the device is in use, but if you go back to the find my iPhone app in iCloud.com, you can either select to erase it, or place it in lost mode, in which case, once the device makes a connection to the internet, it will automatically go into that mode.

  • I have installed ios7 on my iPad 4. After installation it asked me pass code which I have never set. After multiple attempts it is disabled. I don't have backup on my iCloud or iTunes. Is there anyone who can help to enable it or to reverse iPad to ios6.

    I have installed ios7 on my iPad 4. After installation it asked me a pass code which I have never set. After multiple attempts it is disabled. I don't have backup on my iCloud or iTunes. Is there anyone who can help to enable it or to reverse iPad to ios6. I asked Apple store & tech said to format it but I will lose all the data..!

    Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
    Thanks

Maybe you are looking for