
28-02-2008, 22:18
|
 |
|
|
חבר מתאריך: 18.10.05
הודעות: 311
|
|
|
זריקה מן המערכת borland c
כתבתי קוד והקוד בתכלס עובד אבל בסיום הקוד המערכת פשוט שולחת הערה וסוגרת את הסי...
קוד PHP:
#include <stdio.h>
#include <string.h>
void findInfo(int num,char *pass)
{
FILE *fold=NULL;
fold=fopen("define.txt","rb");
int count=0;
while (fgets(pass,10,fold) && count!=num)
num++;
fclose(fold);
}
void updateFile(char c[])
{
FILE *fold=NULL;
FILE*fnew=NULL;
fold=fopen("define.txt","rb");
fnew=fopen("temp.txt","wb");
char a[5]="";
char *d;
findInfo(5,d);
strcat(b,c);
while (fgets(a,10,fold))
{
if(!strcmp(a,d)) //strcmp return 0 if its INBAR.."IF ITS NOT INBAR"
{
fputs(c,fnew);
}
else
{
fputs(a,fnew);
}
}
fclose(fold);
fclose(fnew);
remove("define.txt"); //mohek et akovech sh evarnu mimeno
rename("temp.txt","define.txt");
}
void main()
{
updateFile("hello");
}
כל עזרה תעזור תודה רבה מראש...
_____________________________________
|