daksh1998 Newbie Poster

I have made a program for hotel management. It has a problem that: In the Accounts function, it should reset all the flags of the registered members through the program. But there is a error that it does NOT. I have spent a lot of months, trying to debug this problem, but i couldn't. So please help me. Here is the code of the account function,

void accounts()
{
    int ttt=0;
    struct person payment;
    char aname[21], oname[21];
    char *namea;
    int chec=1, ver=0;
    long int recsize;
    recsize=sizeof(payment);
    f=fopen("C:\\HOTEL.DAT", "rb+");
    if(f == NULL){
        clrscr();
        cprintf("File could not be opened!");
        sleep(4);
        exit(0);
    }
    clrscr();
    cprintf("\n                   *** Pearl Guest House - Payments ***\n\n");
    cprintf("\r\r\rEnter the Name :");
    fflush(stdin);
    scanf("%[^\n]s", &aname);
    namea=strupr(aname);
    strcpy(oname, namea);
    while(fread(&payment, recsize, 1, f) == 1){

        if((payment.flag == 1) && (strcmp(payment.name,oname) == 0)){
            payment.pay=1;
            printf("\n\n Payment Received");
            fflush(stdin);
            getch();
            ver=1;

            fseek(f, -recsize, SEEK_CUR);
            fwrite(&payment, sizeof(payment), 1, f);
            break;

        }

    }

    if(ver!=1){
        printf("\n\n Record not Found!!!");
        fflush(stdin);
        getch();
    }
    //rewind(f);
    fclose(f);
    f=fopen("C:\\HOTEL.DAT", "rb+");
    if(f == NULL){
        clrscr();
        cprintf("File could not be opened!");
        sleep(4);
        exit(0);
    }

    while(fread(&payment, recsize, 1, f) == 1){
        if(payment.pay==0){
            chec=0;
            break;
        }
    }
    //rewind(f);
    f=fopen("C:\\HOTEL.DAT", "rb+");
    if(f == NULL){
        clrscr();
        cprintf("File could not be opened!");
        sleep(4);
        exit(0);
    }

    if(chec==1){
            while(fread(&payment, recsize, 1, f) == 1){
                payment.pay=0;
                fseek(f, -recsize, SEEK_CUR);
                fwrite(&payment, recsize, 1, f);
                ttt++;
                printf("%d", ttt);
            }

            printf("\n\n All payments recieved...\n\nSo, the payments flags are set to 0");
            fflush(stdin);
            getch();
    }
    printf("Before Fclose");
    fclose(f);
    printf("After Fclose");
}

This is my structure person:

struct s_office{   
    char name[16];
    char phone[12];
    }; ...

daksh1998

but that jar doesnt work on systems; on which other jars work but this jar doesnt work

daksh1998

yeah; actually a had made a project in java (using netbeans);
1st project has Database Incl.
2nd is simple
I want to convert both of them into simple executable (maybe JAR)
So that i can run those programs on different machines which
dont have IDE Netbeans. Or dont need any special requirement
I want to run like the other jar executable files(which install themselves)
Please give me reply on how to do it STEP BY STEP
Thanks in advance

daksh1998

@Paladine: Hey buddy; actually i couldnt convert that code you gave in C# to a code in C. Can you or any1 else please convert it in c and give me; or can you please give me a link to somewhere from where i could learn how could i do it.
Thanks in advance
It would be a gr8 help for me
Thanks
Daksh

daksh1998

@dantinkakkar: it is GUI

daksh1998

@dantinkakkar, i dont noe dat it is GUI or CUI, but I know that I have coding and labels, buttons etc used.....

And one more thing, I am able to open a readymade jar program.....

i dont know what to do can anyone please simplify in detail and then tell me

daksh1998 Newbie Poster

Hello!
I have made a java program in Netbeans IDE (version 7.1). I want to make a file that could run my project without IDE (with the help of just Java, JRE, etc)....

I had made a JAR file to try this, but when I open the file, i cant see anything

Please tell me what to do

Thanks in advance

Regards
Daksh shah